首页 > 解决方案 > 创建具有精确 x 轴值的 matplot

问题描述

我想要一个带有“触及”左右轴的绘图数据的图表。如何生成精确水平值在 0 到 1024 之间的图?

axes.xaxis.set_ticklabels([])
axes.set_yticks([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])
axes.set_yticklabels(["0","","","","","5","","","","","10","","","","","15"],fontweight="bold")
plt.savefig('/Users/Desktop/blah.png',bbox_inches='tight')

使用 matplot 库创建的图像。 请注意,数据不会扩展到图表的左侧或右侧

标签: python-3.xmatplotlibplot

解决方案


推荐阅读