用已知的时间段的matplotlib对预定义的列表进行动画列表

发布于 2025-01-22 08:44:14 字数 318 浏览 1 评论 0原文

我生成了两个位置列表(X和Y坐标)。 现在,我想在元素之后对动作(更改x和y)元素进行动画动画。

Matplotlib的Funcanimation功能似乎不起作用。动画(i)函数通常使用x和y的时间依赖性更改;因此,i的功能。但是我知道时间步,我不想在动画函数中实现此依赖关系。

因此,想象一下列表:

  • x = [2,5,1,5,2,8,5,8]
  • y = [5,3,7,2,0,5,9,3]

,已知的时间段

  • DT = 0.1 #秒

我如何对此进行动画?提前致谢!

I generated two location lists (x and y coordinates).
Now I want to animate the movement(changing x and y) element after element.

The FuncAnimation function of matplotlib seems not to work. The animate(i) function usually uses the timedependent changes of x and y; so a function of i. But I know the timestep and I don't want to implement this dependency in the animate function.

So imagine the lists:

  • x = [2,5,1,5,2,8,5,8]
  • y = [5,3,7,2,0,5,9,3]

with a known timestep

  • dt = 0.1 #seconds

How can I animate this? Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文