[SciPy-user] xplt problem

Travis Oliphant oliphant at ee.byu.edu
Tue Sep 10 11:08:23 EDT 2002


> Hi
>
> I am trying this code segment in a script (disp.py). If I run it using
>
> python2 disp.py
>
> it pops up a plot window but does not display the plot. However, if I try
> the same command sequence in the python command interpreter, it works. Am
> I doing something wrong ?
>
> --- disp.py ---
>
> from scipy import xplt
> from scipy import *
>
> from time import sleep
>
> x = arange(0,10.0,0.5)
> y = special.j1(x)
>
> xplt.plot(x,y)
>
> sleep(2)

You are not doing anything wrong.  xplt needs the python interpreter to
continue running to show the plot.  If you were at the python prompt
and did import disp  it would show fine.

You can save eps files from a script though, so you can batch plotting.

Try doing xplt.eps('somefile') after the plot command.  This should save
out somefile.eps in the current directory.

-Travis Oliphant







More information about the SciPy-User mailing list