On 22/08/07, Geoffrey Zhu <[EMAIL PROTECTED]> wrote:
> On 8/20/07, Angus McMorland <[EMAIL PROTECTED]> wrote:
> > On 21/08/07, Geoffrey Zhu <[EMAIL PROTECTED]> wrote:
> > > Hi Everyone,
> > >
> > > I just started to use pylab, and there are two issues I can't figure
> > > out a way to get around.
> > >
> > > 1. show() does not return until I close the plot window. This makes it
> > > impossible to show multiple plots at the same time. How can I show
> > > multiple plots?
> > >
> > > 2. How can I get a handle or object reference to the plot window so
> > > that I can manipulate it specifically?
> >
> > Is this what you're after?
> >
> > import pylab as p
> >
> > f0 = p.figure()
> > f1 = p.figure()
> > ax0 = f0.add_subplot(111)
> > ax0.plot(data)
> > ax1 = f1.add_subplot(111)
> > ax1.plot(otherdata)
> >
> > > I found some references to the API. The API seems quite different from
> > > the plot interface and is considerably low-level. So am just wondering
> > > if using the API is the only way to do these things. It seems to me
> > > that if plot(...) can return an object reference to the chart winodw,
> > > all these can easily be solved.
> > >
> > > Thanks,
> > > Geoffrey
>
> Yes, this solves most of my problems, except that show() still does
> not return until I close the charts.

Yes, this is the problem that Bill describes about needing a separate
GUI thread to allow both the plots and the shell to work
simultaneously. You need to try one of his solutions to get around the
issue - I highly recommend using ipython -pylab, which will take of
all this completely transparently for you.

A.
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to