[英]How to change the limits of axes in matplotlib?
I have plot where the x-axis starts from 0-100. 我有x轴从0-100开始的图。 I want to change it to 10-100.
我想将其更改为10-100。 I would be grateful if someone could give any suggestion.
如果有人可以提出任何建议,我将不胜感激。 Thanks
谢谢
If you just use pyplot
for a simple plot, you can try this function : 如果仅将
pyplot
用于简单绘图,则可以尝试以下功能 :
import matplotlib.pyplot as plt
...
plt.xlim(10, 100)
If you want to set specific axes
, you can try this method : 如果要设置特定的
axes
,可以尝试以下方法 :
import matplotlib.pyplot as plt
...
ax = plt.gca()
ax.set_xlim(10, 100)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.