I found this example for a simple plot on http://www.loria.fr/~rougier/teaching/matplotlib/#simple-plot:
from pylab import *
X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)
plot(X,C)
plot(X,S)
show()
But then absolutely nothing happens. No errors, no warnings, just nothing. Same thing whether it be in the terminal or in Eclipse. I'm using Python 2. Am I missing something?
Thanks!
ion()right after theimportline (this ispylab's interactive plotting command). If it's a display or environment issue, this probably won't help, but it's worth a try.import *. Just doimport pylaband always prefix anypylab-specific entities withpylab.<entity_name>. The extra typing ofpylabeverywhere is awesome! It helps others know where a function came from when they read the code later, and you also don't have to worry about whether a function frompylabhappens to have the same name as some other globally-imported function (and this happens all the time with the wordplotbecause lots of people like to make functions calledplotfor their classes) </pet peeve>