<reponame>DahlitzFlorian/python-snippets<gh_stars>10-100
import animatplot as amp
import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 1, 50)
t = np.linspace(0, 1, 20)

X, T = np.meshgrid(x, t)
Y = np.sin(2 * np.pi * (X + T))

block = amp.blocks.Line(X, Y)
anim = amp.Animation([block])

anim.controls()  # creates a timeline_slider and a play/pause toggle
anim.save_gif("images/line2")  # save animation for docs
plt.show()

import animatplot as amp
import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 1, 50)
t = np.linspace(0, 1, 20)

X, T = np.meshgrid(x, t)
Y = np.sin(2 * np.pi * (X + T))

block = amp.blocks.Line(X, Y)
anim = amp.Animation([block])

anim.controls()  # creates a timeline_slider and a play/pause toggle
anim.save_gif("images/line2")  # save animation for docs
plt.show()
# creates a timeline_slider and a play/pause toggle # save animation for docs