我有以数据帧格式(xarray,类似于 Pandas)保存的数据,我希望用 pcolormesh 对其进行动画处理。
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
def animate(i):
graph_data = mytest.TMP_P0_L1_GLL0[i]
ax1.pcolormesh(graph_data)
FuncAnimation(plt,animate,frames=100)
由于某种原因它不起作用(没有错误,但是当我显示 fig 时它没有动画)。
数据的布局方式是 pcolormesh(mytest.TMP_P0_L1_GLL0[0]) 将输出一个四边形, pcolormesh(mytest.TMP_P0_L1_GLL0[1]) 将输出一个略有不同的四边形......等等
谢谢你的帮助!