On Mon, Jul 19, 2010 at 10:13 AM, Ryan May <rma...@gmail.com> wrote:
> 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?
>
>
I agree, this is probably the best way to nip this in the bud without
breaking backwards compatibility. However, I am concerned that this might
bury other bugs (current or future) by preventing a mistake from making
itself apparent. Is there some way to have a special warning put out in the
"else" branch of that if?
Ben Root
------------------------------------------------------------------------------
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