1
我正在尝试使等高线图动画。下面的例子是足够接近我想(从this archive)实现:动画轮廓图
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0, 2 * np.pi, 0.1)
X,Y = np.meshgrid(x,x)
f1 = np.sin(X) + np.sin(Y)
f2 = np.cos(X) + np.cos(Y)
plt.figure()
C = plt.contourf(f1)
plt.show()
for coll in C.collections:
plt.gca().collections.remove(coll)
C = plt.contourf(f2)
plt.draw()
然而,似乎要与remove
命令一个问题,我不知道如何解决它。
问题是什么?你能指望什么?会发生什么呢? – Falko 2014-08-27 20:54:38