python - 使用来自 3D 数组的 matplotlib.animation.funcanimation 的 3d 动画
问题描述
我试图制作在 python 中传播的 2d 波的 3d 动画,z 轴是波的电场幅度。x 和 y 是一个网格,在该点处测量 t 时刻的幅度,因此 EzTot 是一个 3d 数组,其中 t = 0,..,500 的幅度值(在时间 t 的网格中 (x,y) 处的幅度)由 EzTot[t][x,y]) 给出。我想从时间 0 到 500 动画这个幅度,但我不知道如何。您可以在下面看到时间 500 处波幅的 3d 表面图的代码。
y = range(NY)
z = EzTot[500]
fig = plt.figure()
ax = Axes3D(fig)
x, y = np.meshgrid(x, y)
ax.plot_surface(x, y, z, rstride=1, cstride=1, cmap='hot') ```
plt.show
解决方案
推荐阅读
- css - 关于尝试修改某个网站的文本溢出
- c# - 尝试将值写入 C# 中 Excel 工作表中的单元格时出错
- python - Python Gitlab API - 列出组/子组的共享项目
- asp.net-core - Asp.Net 返回 404 状态码,在 mozilla firefox 中显示空/空白页
- python - 如何使用 Pyautogui 更快、更安全地制作这个 python 自动化代码?
- python - Github:没有运行任何作业
- amazon-web-services - 允许 ECS 任务从 Kinesis 数据流中读取
- python - Python 理解与普通索引
- snowflake-cloud-data-platform - 在 Snowflake 中生成一系列“LIKE”语句的动态 SQL
- c++ - 带有非类型参数的模板的部分特化规则