2024-05-20 00:04:55 发布
网友
很简单,可能是个愚蠢的问题,但我找不到答案:
如何调整Matplotlib中条形图的X轴?在
目前我的代码:
_ = matplotlib.pyplot.bar(names, value, color="blue") _.axis([-11,11,0,1])
退货 -->;AttributeError: 'BarContainer' object has no attribute 'axis'
AttributeError: 'BarContainer' object has no attribute 'axis'
首先,让事情变得简单的一个好方法是导入以下内容:
import matplotlib.pyplot as plt
然后你就可以
你可以用xlim来做这个!在
https://matplotlib.org/api/_as_gen/matplotlib.pyplot.xlim.html
示例:
import matplotlib.pyplot as plt plt.xlim(-11, 11)
首先,让事情变得简单的一个好方法是导入以下内容:
然后你就可以
^{pr2}$你可以用xlim来做这个!在
https://matplotlib.org/api/_as_gen/matplotlib.pyplot.xlim.html
示例:
相关问题 更多 >
编程相关推荐