# --- # jupyter: # jupytext_format_version: '1.2' # kernelspec: # display_name: Python 3 # language: python # name: python3 # language_info: # codemirror_mode: # name: ipython # version: 3 # file_extension: .py # mimetype: text/x-python # name: python # nbconvert_exporter: python # pygments_lexer: ipython3 # version: 3.5.2 # --- # + # %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") ims.append(im) ani = animation.ArtistAnimation(fig, ims) plt.show()