Skip to content

Instantly share code, notes, and snippets.

@yassu
Created October 16, 2014 10:42
Show Gist options
  • Save yassu/0523dad68af6e3c4720d to your computer and use it in GitHub Desktop.
Save yassu/0523dad68af6e3c4720d to your computer and use it in GitHub Desktop.
only one graph by matplotlib
import pylab as p
p.ion()
x = p.arange(0, 2*p.pi, 0.01)
a = 10
curve = lambda t: (t, p.sin(x+t/10.0))
line, = p.plot(x, p.sin(x))
for t in p.arange(1,200):
xs, ys = curve(t)
line.set_ydata(ys)
line.set_xdata(xs)
p.draw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment