how to close (complitly destroy) pylab figure?

View: New views
4 Messages — Rating Filter:   Alert me  

how to close (complitly destroy) pylab figure?

by dmitrey.kroshko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
how to close (complitly destroy) pylab figure?

The feature is highly required for my module "openopt".

I expected something like this will work but it doesn't

from pylab import *
ion()
plot([1, 2, 3, 4], [1, 2, 3, 4])
draw()
# optional: ioff(); doesn't help as well
close('all')

Thank you in advance,
Dmitrey.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Re: how to close (complitly destroy) pylab figure?

by John Hunter-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Sep 21, 2008 at 3:28 PM, dmitrey <dmitrey.kroshko@...> wrote:
> Hi all,
> how to close (complitly destroy) pylab figure?
>
> The feature is highly required for my module "openopt".
>
> I expected something like this will work but it doesn't

Could you be more precise about what you mean when you say it doesn't
work?  It works for me, in that the figure window that was created is
raised, plotted into, and then destroyed.  Please tell us what you
expect to happen and what actually happens, as well as what backend
and matplotlib version you are using/.  Best is to put your code into
a script and run it with --verbose-helpful and post the output here
along with the other requested info.

JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Parent Message unknown Re: how to close (complitly destroy) pylab figure?

by John Hunter-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 22, 2008 at 5:19 AM, dmitrey <dmitrey15@...> wrote:

> John Hunter wrote:
>>
>> On Sun, Sep 21, 2008 at 3:28 PM, dmitrey <dmitrey.kroshko@...>
>> Could you be more precise about what you mean when you say it doesn't
>> work?  It works for me, in that the figure window that was created is
>> raised, plotted into, and then destroyed.  Please tell us what you
>> expect to happen and what actually happens, as well as what backend
>> and matplotlib version you are using/.  Best is to put your code into
>> a script and run it with --verbose-helpful and post the output here
>> along with the other requested info.
>>
>
> Thanks for the feedback, I found that the code works OK from terminal, it
> just fails to close from Eric IDE (the figure continue to exist). Here's
> --verbose-helpful output (while running from the IDE)

[Please "reply to all" to respond on list so others can contribute to
an participate in the discussion.]

One problem is you have set your backend in your matplotlibrc ile to
GTKAgg (this is the default) and Eric is a Qt editor.  For starters,
you will want to set the backend the qt4agg -- see
http://matplotlib.sourceforge.net/doc/html/faq/installing_faq.html#backends

Getting interactive python shells embedded in user interfaces to work
with matplotlib is tricky because of GUI threading issues.  ipython
has tackled this for most major GUIs, and I think they have support
for qt.  Fernando and crew will be able to advise further.

JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Re: how to close (complitly destroy) pylab figure?

by Darren Dale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 22 September 2008 07:55:57 am John Hunter wrote:

> On Mon, Sep 22, 2008 at 5:19 AM, dmitrey <dmitrey15@...> wrote:
> > John Hunter wrote:
> >> On Sun, Sep 21, 2008 at 3:28 PM, dmitrey <dmitrey.kroshko@...>
> >> Could you be more precise about what you mean when you say it doesn't
> >> work?  It works for me, in that the figure window that was created is
> >> raised, plotted into, and then destroyed.  Please tell us what you
> >> expect to happen and what actually happens, as well as what backend
> >> and matplotlib version you are using/.  Best is to put your code into
> >> a script and run it with --verbose-helpful and post the output here
> >> along with the other requested info.
> >
> > Thanks for the feedback, I found that the code works OK from terminal, it
> > just fails to close from Eric IDE (the figure continue to exist). Here's
> > --verbose-helpful output (while running from the IDE)
>
> [Please "reply to all" to respond on list so others can contribute to
> an participate in the discussion.]
>
> One problem is you have set your backend in your matplotlibrc ile to
> GTKAgg (this is the default) and Eric is a Qt editor.  For starters,
> you will want to set the backend the qt4agg -- see
> http://matplotlib.sourceforge.net/doc/html/faq/installing_faq.html#backends
>
> Getting interactive python shells embedded in user interfaces to work
> with matplotlib is tricky because of GUI threading issues.  ipython
> has tackled this for most major GUIs, and I think they have support
> for qt.  Fernando and crew will be able to advise further.

Ipython does support the qt backends. I also use eric4, which works just fine
with the qt4 backend.

Darren

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users