Jupyter Notebook上でMatplotlibのアニメーション機能を使い等高線のアニメーションを作成したいのですが上手くいきません.
Python%matplotlib
1from numpy import * 2import matplotlib.pyplot as plt 3import matplotlib.animation as animation 4 5a = 0 6f = zeros((10, 100, 100)) 7x = linspace(0, 10, 100) 8y = x 9x, y = meshgrid(x, y) 10ims = [] 11 12fig = plt.figure() 13 14for i in range(10): 15 a += 1 16 f = sin(x-a) + cos(y-a) 17 im = plt.contour(x, y, f) 18 ims.append(im) 19 20ani = animation.ArtistAnimation(fig, ims)
上のようなコードを書いてみたのですが,実行するとアニメーションにならず全部重なった状態で出力されてしまします.自分なりに調べてはみましたが解決に至らなかった為,どなたかご教授願います.
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/14 01:19
退会済みユーザー
2018/02/14 01:35
2018/02/14 02:13
退会済みユーザー
2018/02/14 02:15