Hi Mike,

Mike Kaufman, on 2012-01-11 19:30,  wrote:
> Given the code snippet below with clf() #1 uncommented works like one 
> would expect - both plots are drawn. If #1 is commented out and #2 is 
> uncommented, then the figure is cleared and neither plot is drawn. Is 
> this the correct behavior? It seems like a bug to me.

Seems to me like this is the intended behavior and not a bug. I'm
not sure what you were expecting to happen with that second call
to clf. You're clearing the whole figure, so even though the
axes you have in the grid variable have references to f, f has
disowned them!

  In [39]: grid = AxesGrid(f, 111, (1,2))
  
  In [40]: f.axes
  Out[40]: 
  [<mpl_toolkits.axes_grid1.axes_divider.LocatableAxes at 0xb7c002c>,
   <mpl_toolkits.axes_grid1.axes_divider.LocatableAxes at 0xb8948cc>,
   <mpl_toolkits.axes_grid1.axes_grid.CbarAxes at 0xb810dac>,
   <mpl_toolkits.axes_grid1.axes_grid.CbarAxes at 0xb97486c>]
  
  In [41]: plt.clf()
  
  In [42]: f.axes
  Out[42]: []

Perhaps you wanted to simply to clear the individual axes? You
can do that with [g.cla() for g in grid] instead of your call to
plt.clf()

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to