【发布时间】:2019-02-11 05:15:30
【问题描述】:
更新:我已经简化了我最初的问题。
我想创建一个动画情节,但我的实现是跳帧。
x = np.arange(0,5,0.1)
y = np.cos(3*x)
def f(i):
plt.plot(x[:i],y[:i]);
plt.gca().axis([0,5,-1,1])
plt.gca().set_title(f'{i}')
interactive(f, i=Play(value=0, min=0, max=50, step=1))
而不是我想要的步长 (1),它以每帧大约 5 步的速度播放。
这种行为发生在 notebook 和 jupyterlab 以及 inline 和 notebook 前端 (%matplotlib notebook)
【问题讨论】:
-
您能否举一个您的代码示例,其中包含一些随机数据作为输入?
-
请注意,没有minimal reproducible example,任何人都无法复制此内容。
-
我添加了一个简单的例子和一个 gif @ac24
标签: matplotlib jupyter-notebook jupyter jupyter-lab ipywidgets