【发布时间】:2015-11-17 22:33:18
【问题描述】:
我想设置一个y轴的下限大于等于0的要求,我确实不想把y轴的下限设置为正好0.
我不想将 y 轴最小限制设置为 0,因为绘图如下:
我想要求 y 轴的最小限制大于或等于 0,而不是完全设置为 0,以便绘图如下所示:
那么,我应该怎么做而不是下面的呢?
axes = matplotlib.pyplot.gca()
axes.xaxis.set_major_formatter(FormatStrFormatter("%.0f"))
axes.yaxis.set_major_formatter(FormatStrFormatter("%.0f"))
axes.set_xlim(left = 0)
axes.set_ylim(bottom = 0)
【问题讨论】:
标签: python matplotlib limit axes