Control of thread/program not returning to ipython after creating a plot.

Either I updated something that changed Matplotlib's behavior or I am
missing something, but when I make a plot in ipython, control is not
returning to the prompt - I can't do anything until I close the plot.
Here is exactly what I am doing:

ipython --pylab

x=arange(10)
y=x**2

figure()
plot(x,y)
show()

Also, I am not sure if that is right. In the past I remember just being
able to type plot() and the figure came up and control went back to
ipython to continue. But I could be wrong.

Then, if I want to do anything else, I have to close the window. The
backend I am using is WXAgg. I also noticed that if I use the GTKAgg
backend, control does not return to the prompt even after closing the
plot. I have to hit ctl-c to get the prompt back. I have tried this
both with ion() and ioff().

I don't ever remember having to close the plot or hit control-c to keep
working. I googled and did not really see anything relevant. Could
anyone tell me what I am missing or what I need to do so that I can
plot in ipython, leave the plot up, and then continue working?

I have matplotlib 1.0.0 and ipython 0.10.1

Thanks for any help!

Most likely, you were used to interactive mode being on. A new installation of matplotlib might have over-written your matplotlibrc file, resetting the option to False. Find your matplotlibrc file and change interactive to True to get the behavior you want.

I hope that helps!

Ben Root

···

On Wed, Nov 17, 2010 at 6:54 PM, Collin Day <dcday137@…878…287…> wrote:

Either I updated something that changed Matplotlib’s behavior or I am

missing something, but when I make a plot in ipython, control is not

returning to the prompt - I can’t do anything until I close the plot.

Here is exactly what I am doing:

ipython --pylab

x=arange(10)

y=x**2

figure()

plot(x,y)

show()

Also, I am not sure if that is right. In the past I remember just being

able to type plot() and the figure came up and control went back to

ipython to continue. But I could be wrong.

Then, if I want to do anything else, I have to close the window. The

backend I am using is WXAgg. I also noticed that if I use the GTKAgg

backend, control does not return to the prompt even after closing the

plot. I have to hit ctl-c to get the prompt back. I have tried this

both with ion() and ioff().

I don’t ever remember having to close the plot or hit control-c to keep

working. I googled and did not really see anything relevant. Could

anyone tell me what I am missing or what I need to do so that I can

plot in ipython, leave the plot up, and then continue working?

I have matplotlib 1.0.0 and ipython 0.10.1

Thanks for any help!

Another data point -

I tried Qt4Agg - it also works interactively - ie it goes back to the
ipython cmd line. I also noticed when I start ipython --pylab, the
following error messages occur:

** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
** Message: pygobject_register_sinkfunc is deprecated (GtkObject)

-C

···

On Wed, 17 Nov 2010 19:00:54 -0600 Benjamin Root <ben.root@...1304...> wrote:

On Wed, Nov 17, 2010 at 6:54 PM, Collin Day <dcday137@...287...> > wrote:

> Either I updated something that changed Matplotlib's behavior or I
> am missing something, but when I make a plot in ipython, control is
> not returning to the prompt - I can't do anything until I close the
> plot. Here is exactly what I am doing:
>
> ipython --pylab
>
> x=arange(10)
> y=x**2
>
> figure()
> plot(x,y)
> show()
>
> Also, I am not sure if that is right. In the past I remember just
> being able to type plot() and the figure came up and control went
> back to ipython to continue. But I could be wrong.
>
> Then, if I want to do anything else, I have to close the window.
> The backend I am using is WXAgg. I also noticed that if I use the
> GTKAgg backend, control does not return to the prompt even after
> closing the plot. I have to hit ctl-c to get the prompt back. I
> have tried this both with ion() and ioff().
>
> I don't ever remember having to close the plot or hit control-c to
> keep working. I googled and did not really see anything relevant.
> Could anyone tell me what I am missing or what I need to do so that
> I can plot in ipython, leave the plot up, and then continue working?
>
> I have matplotlib 1.0.0 and ipython 0.10.1
>
> Thanks for any help!
>
>
Most likely, you were used to interactive mode being on. A new
installation of matplotlib might have over-written your matplotlibrc
file, resetting the option to False. Find your matplotlibrc file and
change interactive to True to get the behavior you want.

I hope that helps!

Ben Root

Interesting. It is possible that the gtk backend might have been compiled against gtk development libraries that do not match your current gtk library. What have you updated recently, and how did you do it?

Ben Root

···

On Wed, Nov 17, 2010 at 7:38 PM, Collin Day <dcday137@…287…> wrote:

On Wed, 17 Nov 2010 19:00:54 -0600 > > Benjamin Root <ben.root@…3286…> wrote:

Another data point -

I tried Qt4Agg - it also works interactively - ie it goes back to the

ipython cmd line. I also noticed when I start ipython --pylab, the

following error messages occur:

** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)

** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)

** Message: pygobject_register_sinkfunc is deprecated (GtkObject)

Well, I am a Gentoo user, so I was doing the usual emerge -uavDN world
which updates everything, so I don't know what exactly has changed.
What I can tell you is that I have gtk 2.20.1 and wxGtk 2.8.11. I
could try updating again (I update about every 1-2 weeks to keep
current and avoid issues that can arise when you update from older
stuff). Also, I can just use TkAgg as it works. If it is something
you are interested in, I don't mind trying some debug stuff if you let
me know what you need to debug. Otherwise - tkAgg appears to be the
way to go:) At least someone knows there is a potential problem. How
about I try a system update and let you know if I still see problems?

-C

···

On Wed, 17 Nov 2010 19:46:34 -0600 Benjamin Root <ben.root@...1304...> wrote:

On Wed, Nov 17, 2010 at 7:38 PM, Collin Day <dcday137@...287...> > wrote:

> On Wed, 17 Nov 2010 19:00:54 -0600 > > Benjamin Root <ben.root@...1304...> wrote:
>
> Another data point -
>
> I tried Qt4Agg - it also works interactively - ie it goes back to
> the ipython cmd line. I also noticed when I start ipython --pylab,
> the following error messages occur:
>
> ** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
> ** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
> ** Message: pygobject_register_sinkfunc is deprecated (GtkObject)
>
>
Interesting. It is possible that the gtk backend might have been
compiled against gtk development libraries that do not match your
current gtk library. What have you updated recently, and how did you
do it?

Ben Root

So I tried updating and rebuilding Matplotlib - no luck - something (at
least on my system) is goofy with the GTK(Agg),WX(Agg), and
Fltk(Agg) backends. But the TkAgg backend works great. So I will
stick with that, but if anyone else sees this problem and it becomes an
issue, I'd be happy to help debug it in any way I can.

-C

···

On Wed, 17 Nov 2010 19:46:34 -0600 Benjamin Root <ben.root@...1304...> wrote:

On Wed, Nov 17, 2010 at 7:38 PM, Collin Day <dcday137@...287...> > wrote:

> On Wed, 17 Nov 2010 19:00:54 -0600 > > Benjamin Root <ben.root@...1304...> wrote:
>
> Another data point -
>
> I tried Qt4Agg - it also works interactively - ie it goes back to
> the ipython cmd line. I also noticed when I start ipython --pylab,
> the following error messages occur:
>
> ** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
> ** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
> ** Message: pygobject_register_sinkfunc is deprecated (GtkObject)
>
>
Interesting. It is possible that the gtk backend might have been
compiled against gtk development libraries that do not match your
current gtk library. What have you updated recently, and how did you
do it?

Ben Root