小编Jar*_*red的帖子

Matplotlib animate不会更新刻度标签

我试图通过使动画运行增加x值来修改和示例.我想更新x轴刻度标签以根据x值更新.

我试图在1.2中使用动画功能(特别是FuncAnimation).我可以设置xlimit但是tick标签没有更新.我也尝试明确设置刻度标签,但这不起作用.

我看到了这个:动画matplotlib轴/刻度,我试图在animation.py中调整bbox,但它不起作用.我对matplotlib相当新,并且对于解决这个问题的实际情况不太了解,所以我将不胜感激任何帮助.

谢谢

"""
Matplotlib Animation Example

author: Jake Vanderplas
email: vanderplas@astro.washington.edu
website: http://jakevdp.github.com
license: BSD
Please feel free to use and modify this, but keep the above information. Thanks!
"""

import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation

# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(ylim=(-2, 2))
line, = ax.plot([], [], lw=2)

# initialization function: plot …
Run Code Online (Sandbox Code Playgroud)

python plot animation matplotlib

3
推荐指数
1
解决办法
3530
查看次数

标签 统计

animation ×1

matplotlib ×1

plot ×1

python ×1