plotting from within ipython, and then go on in the shell calculations

Greetings.

What i want to do is something like:

ipython ...

···

----

t=linspace(0,2,50)
y=sin(2*pi*t)

pyplot.plot(t,y)
pyplot.show()

----

I get the plot here ... but now i want to do some more stuff in
the ipython shell (and possibly have the plot still open)

How do i free the shell from the plot thread?

Thanks

--
The king who needs to remind his people of his rank, is no king.

To gain that which is worth having, it may be necessary to lose everything else.

qubax@...1843... wrote:

Greetings.

What i want to do is something like:

ipython ...

----

t=linspace(0,2,50)
y=sin(2*pi*t)

pyplot.plot(t,y)
pyplot.show()

----

I get the plot here ... but now i want to do some more stuff in
the ipython shell (and possibly have the plot still open)

How do i free the shell from the plot thread?

Thanks

http://matplotlib.sourceforge.net/users/shell.html

bottom line - don't call show.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

but i want to:
1) plot something
2) go on in ipython (with the figure/plot staying on)

is that really not possible?

thanks,
q

···

On Tue, Oct 13, 2009 at 03:54:22PM -0600, Jeff Whitaker wrote:

qubax@...1843... wrote:
> Greetings.
>
> What i want to do is something like:
>
> ipython ...
>
> ----
>
> t=linspace(0,2,50)
> y=sin(2*pi*t)
>
> pyplot.plot(t,y)
> pyplot.show()
>
> ----
>
> I get the plot here ... but now i want to do some more stuff in
> the ipython shell (and possibly have the plot still open)
>
> How do i free the shell from the plot thread?
>
> Thanks
>
>
>
>
http://matplotlib.sourceforge.net/users/shell.html

bottom line - don't call show.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
The king who needs to remind his people of his rank, is no king.

To gain that which is worth having, it may be necessary to lose everything else.

qubax@...1843... wrote:

but i want to:
1) plot something
2) go on in ipython (with the figure/plot staying on)

is that really not possible?

thanks,
q
  
That's exactly what happens in ipython (in pylab mode), if you don't call show.

-Jeff

···

On Tue, Oct 13, 2009 at 03:54:22PM -0600, Jeff Whitaker wrote:
  

qubax@...1843... wrote:
    

Greetings.

What i want to do is something like:

ipython ...

----

t=linspace(0,2,50)
y=sin(2*pi*t)

pyplot.plot(t,y)
pyplot.show()

----

I get the plot here ... but now i want to do some more stuff in
the ipython shell (and possibly have the plot still open)

How do i free the shell from the plot thread?

Thanks

http://matplotlib.sourceforge.net/users/shell.html

bottom line - don't call show.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
    
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

okay. don't shoot me

you need to start ipython with:

   ipython -pylab

as noted in: http://matplotlib.sourceforge.net/users/shell.html

made someone else can benefit from my mistake

sorry for bothering you

q

···

On Wed, Oct 14, 2009 at 02:09:21AM +0200, qubax@...1843... wrote:

but i want to:
1) plot something
2) go on in ipython (with the figure/plot staying on)

is that really not possible?

thanks,
q

On Tue, Oct 13, 2009 at 03:54:22PM -0600, Jeff Whitaker wrote:
> qubax@...1843... wrote:
> > Greetings.
> >
> > What i want to do is something like:
> >
> > ipython ...
> >
> > ----
> >
> > t=linspace(0,2,50)
> > y=sin(2*pi*t)
> >
> > pyplot.plot(t,y)
> > pyplot.show()
> >
> > ----
> >
> > I get the plot here ... but now i want to do some more stuff in
> > the ipython shell (and possibly have the plot still open)
> >
> > How do i free the shell from the plot thread?
> >
> > Thanks
> >
> >
> >
> >
> http://matplotlib.sourceforge.net/users/shell.html
>
> bottom line - don't call show.
>
> -Jeff
>
> --
> Jeffrey S. Whitaker Phone : (303)497-6313
> Meteorologist FAX : (303)497-6449
> NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
> 325 Broadway Office : Skaggs Research Cntr 1D-113
> Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> matplotlib-users List Signup and Options

--
The king who needs to remind his people of his rank, is no king.

To gain that which is worth having, it may be necessary to lose everything else.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
The king who needs to remind his people of his rank, is no king.

To gain that which is worth having, it may be necessary to lose everything else.

14/10/09 @ 02:38 (+0200), thus spake qubax@...1843...:

okay. don't shoot me

you need to start ipython with:

   ipython -pylab

or alternatively, start ipython normally, import matplotlib.pyplot
and then call matplotlib.pylot.ion() which turns the 'interactive
mode' on.

then when you create a figure, a window will pop up, but the shell
will still be operative.

···

--
Ernest

Ernest Adrogué wrote:

14/10/09 @ 02:38 (+0200), thus spake qubax@...1843...:

okay. don't shoot me

you need to start ipython with:

   ipython -pylab

or alternatively, start ipython normally, import matplotlib.pyplot
and then call matplotlib.pylot.ion() which turns the 'interactive
mode' on.

then when you create a figure, a window will pop up, but the shell
will still be operative.

No, you have to call ipython with a threading option:
        -gthread, -qthread, -q4thread, -wthread, -pylab

Eric

13/10/09 @ 14:35 (-1000), thus spake Eric Firing:

Ernest Adrogué wrote:
>14/10/09 @ 02:38 (+0200), thus spake qubax@...1843...:
>>okay. don't shoot me
>>
>>you need to start ipython with:
>>
>> ipython -pylab
>>
>
>or alternatively, start ipython normally, import matplotlib.pyplot
>and then call matplotlib.pylot.ion() which turns the 'interactive
>mode' on.
>
>then when you create a figure, a window will pop up, but the shell
>will still be operative.
>

No, you have to call ipython with a threading option:
       -gthread, -qthread, -q4thread, -wthread, -pylab

Ah, I didn't know that. In my Debian machine, it works without need to
specify any of these options, though.

···

--
Ernest

For the TkAgg backend, you don't have to call ipython with a threading
option, it works "as is".

Johann

···

On Wednesday 14 October 2009, Ernest Adrogué wrote:

13/10/09 @ 14:35 (-1000), thus spake Eric Firing:
> Ernest Adrogué wrote:
> No, you have to call ipython with a threading option:
> -gthread, -qthread, -q4thread, -wthread, -pylab

Ah, I didn't know that. In my Debian machine, it works without need
to specify any of these options, though.