Jack Sankey wrote:
> I'm not sure if this is a matplotlib issue or what, but all of a sudden 
> I was not able to do gca() or gcf() correctly.
> 
> A simple command-line on pyshell (using wxAgg backend) went like this:
I'm not familiar with pyshell, but evidently it is turning interactive 
mode on, correct?
> 
> import pylab
> pylab.plot([1,2,1]) # figure pops up
> pylab.gca().clear(); pylab.show() # nothing happens
Why are you doing this?  In interactive mode, you should not be calling 
show() at all.  And, you are mixing pylab and OO interfaces in a strange 
way; if you want to work interactively via the pylab interface, you 
should use pylab.cla() and pylab.clf().  If you want to work 
interactively but *mostly* with the OO interface, then you can call axes 
methods like clear(), but you need to put in pylab.draw() when you want 
the figure redrawn.

> pylab.gcf().clear(); pylab.show() # nothing happens
With interactive mode off, in a script, show() should never be called 
more than once; it should be the last plot-related line of the script.
> pylab.clf() # works fine
because it is internally calling pylab.draw_if_interactive().

Eric
> 
> I've played with getting the current figure, storing it in a temporary 
> variable a, trying "a.clear()" trying any manipulations and they don't 
> work. It's like the figures/axes returned by gca() and gcf() no longer 
> correspond to the only open figure I can see.
> 
> I don't have time to figure it out (I have a paper due and I've already 
> thrown 3 hours at figuring out why my scripts aren't working), and I 
> know there's an outside chance it's all my fault. I've uninstalled 
> everything and I'm putting enthought on (older matplotlib). Anyway, I'm 
> sorry if this turns out to be my fault, but can anyone test/confirm/deny 
> this behavior? I was using the latest mpl 0.98.3 and python 2.5.
> 
> Thanks,
> -Jack
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to