python - 使用 matplotlib.figure 更改刻度间隔
问题描述
有没有办法改变 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.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.set_xlim.html
推荐阅读
- svg - 有没有办法从一个 svg 中保存多个 svg?
- apache-spark - 避免广播嵌套循环连接
- html - 如何修复搜索图标更改为下拉菜单项的值?
- python - Python tkinter--ProgrammingError: 1064 (42000)
- macos - Kubernetes 无法删除 mac 上的图像/docker 无法删除图像
- python-3.x - OSError: [Errno 24] 多线程 pwntools 时
- python - How can I deploy a flask app on Lightsail with crash protection?
- python - 蟒蛇说“'pyspark'没有属性'ml'”,我不知道如何解决这个问题
- mysql - 如何使用codeigniter选择多个where条件?
- php - Laravel excel library prints blank excel file