python - 更改 x 轴比例 im matplotlib imshow?
问题描述
代码给了我下面的图片。我需要在 x 轴上有更高的精度。现在我在每 100 个样本中有下一个点。但我希望更频繁地打印点(每 50 个样本)。
例如(x 轴): - 现在我有:0 100 200 ... - 我想要:0 50 100 150 200 ...
是否可以在此图像上使用网格制作此图像(在两个轴(x 和 y)的每个打印点上画线)?
Output:<br>
Python 代码:'energy' 是 int32 类型的 numpy 二维数组(60,736)。
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111)
plt.imshow(energy, aspect=10)
ax.axes.set_aspect(aspect=5)
plt.show()
解决方案
推荐阅读
- nopcommerce - 如何在 nopcommerce 中实施“反向竞价”(反向拍卖)?(供应商竞标客户发布的特定工作)
- php - 将图像编码为 base64 无法正常工作
- google-oauth - 子子域上的 google oauth2 - 不是有效的来源
- python-3.x - 获取 Outlook 约会后无法调用 win32com.client.Dispatch AppointmentItem 的“大小”属性
- swift - 从导航控制器回到视图控制器?
- java - 关于spring-data中实体之间的映射
- symfony - Symfony 4 和 Behat:如何注入实体管理器
- java - 将 JSP 部署给用户,例如 setup.exe 或 .dmg 文件
- scala - 如何将 Window 函数应用于 DataFrame 中的多个列
- c# - Windows 模板工作室 - 导航