Skip to content

[mpl_toolkits.axes_grid1] Can't remove host axes' twin axes #4896

Closed

Description

@smheidrich

Axes created via mpl_toolkits.axes_grid1.host_subplot(...).twin() (or twinx(), twiny()) can not be removed via their remove() method. Non-mpl_toolkit twin axes can be removed; this is specific to mpl_toolkit.


Example:

from mpl_toolkits.axes_grid1 import host_subplot
h = host_subplot(111)
t = h.twin()
t.remove()

raises NotImplementedError: cannot remove artist.


Is there a way around this that I'm missing? I'm using axes_grid1's twin() to interactively create axes with user-defined transforms and want to be able to destroy them as well, of course. Alternatively, it would suffice for me to be able to change the transform (given initially via twin(aux_transform)), but even that seems not possible.


matplotlib version: 1.5.dev1, at commit 2c95107db6c09d42336a8ce901ea57ccae34f3ca
Python version: 3.4.2

Activity

  1. tacaswell commented on Aug 10, 2015

    @tacaswell
    Member

    The remove method is a place-holder that needs to be installed at instantiation time by assigning a function to a._remove_method (have a look at the add_* methods on Axes). axes_grid just needs to do the same thing.

  2. added this to the milestone on Aug 10, 2015
  3. smheidrich commented on Oct 15, 2015

    @smheidrich
    ContributorAuthor

    Thanks for merging the PR, issue should be fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions