0
我以dataframe格式(xarray,类似于Pandas)保存数据,并且我希望使用pcolormesh对其进行动画处理。Matplotlib使用Matplotlib中的FuncAnimation命令在数据框中设置动画数据
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)
它不工作的原因(没有错误,但当我显示无花果它不是动画)。
的数据被布置的方式是,pcolormesh(mytest.TMP_P0_L1_GLL0 [0])将输出一个quadmesh,pcolormesh(mytest.TMP_P0_L1_GLL0 [1])将输出一个稍微不同的quadmesh ...等
谢谢你的帮助!