python - 在 matplotlib 的子图中使用 xscale 和 yscale
问题描述
我创建像
fig, (ax1, ax2) = plt.subplots(1, 2, sharex='col', sharey='row')
我和
ax1.plot(x, y)
ax2.plot(x, y)
现在我想将轴格式化为
ax1.xscale('log')
ax1.yscale('log')
但这导致
AttributeError: 'AxesSubplot' object has no attribute 'yscale'
如何格式化两个子图的轴?
解决方案
推荐阅读
- php - 从 Mysql 中提取数据到新的 Google Sheet
- javascript - 尝试删除服务工作者时如何修复 ESLint 错误
- azure - 如何在 Cosmo 数据库中存储数据(不是纯文本)?
- javascript - 基于Javascript中数组列表中的值返回父键
- mysql - MySQL 语句 - 选择 Concat 之类的位置
- amazon-web-services - 连接到极光无服务器
- sql - 在oracle sql中将字符串格式的日期转换为日期时间格式
- git - 我可以恢复没有在本地保存的已删除 git 分支吗?
- slack-api - 在 Slack 中将远程文件作为直接消息共享
- image-processing - 重建图像与原始图像之间的误差图