Skip to content

[ENH]: Axes.get_shared_x_axes() returning mutable Grouper #27161

Closed

Description

@raamana

Problem

I tried to post this on discourse, but that forum is too restrictive in flagging my question as spam (just because I am linking to the specific lines of code to provide context).. so here goes:

it used to be that Axes.get_shared_x_axes() returned a cbook.Grouper() which had a .join() method, but now it is returning an cbook.GrouperView() that is IMMUTABLE. It is breaking my tool and I don't even understand the rationale for such backward incompatible change.

regardless, I need a workaround that would continue to work with future versions of matplotlib. Much appreciate your help in pointing me to the right methods and properties to achieve the same effect as this.

thanks very much.

Proposed solution

revert to the previous behaviour of Axes.get_shared_x_axes() returning a mutable Grouper

Activity

  1. changed the title [-][ENH]: [/-] [+][ENH]: Axes.get_shared_x_axes() returning mutable Grouper[/+] on Oct 20, 2023
  2. jklymak commented on Oct 21, 2023

    @jklymak
    Member
  3. ksunden commented on Oct 21, 2023

    @ksunden
    Member

    This was deprecated in 3.6.0 in #21584 and should have been warning for several releases now.

    https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.6.0.html#groupers-from-get-shared-x-axes-get-shared-y-axes-will-be-immutable

    Calling sharex is the expected api for doing this task, and additionally makes sure that the axes are consistent when sharing is started (though fundementally it is doing the same thing to the underlying Grouper object).

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions