On Fri, Sep 3, 2010 at 4:14 AM, Benjamin Root <ben.r...@ou.edu> wrote:
> I think there are multiple issues here.  Primarially, there is the issue
> that Axes3D is attaching itself to a figure.  However, in the interest of
> backwards-compatibility, we can't just fix this outright.  There is also the
> issue that there are multiple places in the Figure class that are adding
> axes to the figure object.  Ideally, shouldn't we have a single function
> that performs proper checks and adds an axes?  Then that function should be
> used in the other class functions to perform this action.  In my opinion,
> there is too much duplicated code here.

While I agree that we need to do something with the duplicated code, I
think our priority should be fixing a bug.
The easiest solution (that is backward compatible) seems to be
registering an Axes class that does not add itself to the figure.
For example,

class Axes3DBase(Axes):
    # All of the original Axes3D stuff, but do not add itself to the
figure during the initialization

class Axes3D(Axes3DBase):
    def __init__(self, ...)
        Axes3DBase.__init__(self, ...)
        self.fig.add_axes(self)

# And register Axes3DBase instead of Axes3D
import matplotlib.projections as proj
proj.projection_registry.register(Axes3DBase)

Regards,

-JJ

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to