On Sun, Jul 18, 2010 at 6:16 PM, Benjamin Root <ben.r...@ou.edu> wrote:
> A few corrections.  First, I wrong, it is unusual.  The second axes that I
> noticed in a 2d case came from a colorbar being added.  Second, in the 3d
> case, it was the Axes3DSubplot object being added twice, not the regular
> object like I originally said.
>
> The cause of this is due to the Axes3D initializer adding itself to the
> figure object being passed in.  This initializer is called when
> add_subplot() is called, so add_subplot also adds the axes when it is
> finished making it.  For normal projections, the initializer does not add
> itself to the axes.
>
> Removing the add_axes in the Axes3D initializer would "solve" the issue
> outright, however, there are plenty of legacy code where Axes3D is called
> with a figure passed in in order to create the axes, and this would break
> that use pattern.

I think the fact that add_axes will just blindly add a duplicate axes
is a bug. So why not have add_axes do something like the following:

if ax not in axes_list:
  axes_list.append(ax)
  <more stuff>

Anyone see anything wrong with this approach?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to