基本的な質問になってしまい申し訳ありません。
python3とipython notebookを使っています。
例えば、matplotlibで下のようなsin波のアニメーションを作成したときに、
sin波とx軸の間を塗りつぶしたい場合はどのようにすればよろしいのでしょうか。
python
1import numpy as np 2import matplotlib.pyplot as plt 3import matplotlib.animation as animation 4%matplotlib nbagg 5 6fig = plt.figure() 7x = np.arange(0, 10, 0.1) 8 9ims = [] 10for a in range(10): 11 y = np.sin(x - a) 12 line, = plt.plot(x, y,"r") 13 ims.append([line]) 14 15ani = animation.ArtistAnimation(fig, ims) 16ani.save('sin.gif', writer="imagemagick")
目標としては下の画像がアニメーションとして流れるようにしたいです。
よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。