Q&A
前提・実現したいこと
spyderでグラフのアニメーションを動かしたいのですが、グラフが動きません。
使用機器:Macbook pro
OS:macOS high sierra
発生している問題・エラーメッセージ
エラーメッセージ
該当のソースコード
from matplotlib import pyplot as plt from matplotlib import animation def create_circle(): circle = plt.Circle((0, 0), 0.05) return circle def update_radius(i, circle): circle.radius = i*0.5 return circle, def create_animation(): fig = plt.gcf() ax = plt.axes(xlim=(-10, 10), ylim=(-10, 10)) ax.set_aspect('equal') circle = create_circle() ax.add_patch(circle) anim = animation.FuncAnimation(fig, update_radius, fargs = (circle,), frames=30, interval=50) plt.title('Simple Circle Animation') plt.show() if __name__ == '__main__': create_animation()
試したこと
Preference→Ipython console→Graphic→backedでautomaticにしましたが、アニメーションが動きませんでした。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。