を加えることで、matplotlibの__nbagg__が有効になり、Jupyter上でアニメーションが再生できます。 matplotlibの公式の説明によると、__nbagg__はmatplotlib 1.4で新たに追加された機能で、Jupyter上でのインタラクティブな画像表示を実現するための機能だそうです。 以下はデモのソースコードです。 %matplotlib nbagg import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation fig = plt.figure() x = np.arange(0, 10, 0.1) ims = [] for a in range(50): y = np.sin(x - a) im = plt.plot(x, y, "r")
