【发布时间】:2022-01-19 16:29:07
【问题描述】:
【问题讨论】:
-
plt.ylim(0, 100) -
这能回答你的问题吗? setting y-axis limit in matplotlib
-
是的,谢谢@Stef
标签: python matplotlib
【问题讨论】:
plt.ylim(0, 100)
标签: python matplotlib
有几点:
所以解决办法是
from matplotlib import pyplot
from matplotlib import ticker
fig, ax = pyplot.subplots(figsize=(6, 4))
ax.bar(...)
# or df.plot.bar(..., ax=ax)
ax.yaxis.set_major_locator(ticker.MultipleLocator(10))
ax.set_ylim(bottom=0, top=100)
【讨论】: