有没有办法改变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()
使用maptplotlib.pyplot就很直接了。
ax.set_xlim(xmin = , xmax = )
你可以在这里看到完整的文档。
https:/matplotlib.org3.1.1api_as_genmatplotlib.axes.Axes.set_xlim.html。