Created
October 16, 2014 10:42
-
-
Save yassu/0523dad68af6e3c4720d to your computer and use it in GitHub Desktop.
only one graph by matplotlib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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