用matplotlib.figure改变刻度区间。

问题描述 投票:1回答:1

有没有办法改变x值的区间呢? 它们现在很混乱,我不需要显示每个人,我可能只需要每20个显示1个。

图的图片

def create_window_graph(xas,yas,labname):

fig = Figure(figsize=(8, 4), dpi=80)

fig.add_subplot(111).plot(xas,yas, 'r--', label = labname) 


fig.legend()
python matplotlib graph figure
1个回答
0
投票

使用maptplotlib.pyplot就很直接了。

ax.set_xlim(xmin = , xmax = )

你可以在这里看到完整的文档。

https:/matplotlib.org3.1.1api_as_genmatplotlib.axes.Axes.set_xlim.html。

© www.soinside.com 2019 - 2024. All rights reserved.