简体   繁体   English

使用 matplotlib.figure 更改刻度间隔

[英]Change tick interval with matplotlib.figure

Is there a way to change the interval for the x-value?有没有办法改变 x 值的间隔? they're pretty clumped up right now and i dont need to show everyone, i may only need to show 1 per 20.他们现在非常聚集,我不需要向所有人展示,我可能只需要展示每 20 个人中的 1 个。

Pic of the graph图表图片

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()

Using maptplotlib.pyplot it's pretty straightforward:使用 maptplotlib.pyplot 非常简单:

ax.set_xlim(xmin =, xmax = ) ax.set_xlim(xmin =, xmax = )

You can see the full documentation here:您可以在此处查看完整文档:

https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.set_xlim.html https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.set_xlim.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM