enter image description here我尝试使用python在powerBi上绘制一个条形图,我希望y轴上的值在间隔10之后,例如0- 10、10 -20直到100。但实际上,它显示在间隔25之后,例如0-25、26-50等
import matplotlib.pyplot as plt
ax=plt.gca()
#dataset.plot(kind='bar',x='Day',y='Feed_Req_to_Standard',ax=ax)
dataset.plot(kind='bar',x='Day',y=['Feed_%Diff_From_Stand','Feed_Req_to_Standard'], color=['red','green'],ax=ax)
plt.ylim(bottom= -100, top= 100)
plt.xlabel('Days')
plt.show()
1条答案
按热度按时间nbysray51#
你可以使用
matplotlib.axes.Axes.set_yticks()
函数来设置y轴上的刻度位置和标签。如果你想仔细看看,here is the documentation。应用到你的问题上,它可能会像这样应用(注意,我还没有测试它,因为我没有访问你的数据)。