Skip to content

DOC: Document patch deprecation #20635

Closed

Description

@larsoner

Problem

In #20481 colorbar.patch was deprecated, so doing for example (in our code that makes a DraggableColorbar):

cbar.patch.figure.canvas.mpl_connect('button_press_event', on_press)

Now yields:

The patch attribute was deprecated in Matplotlib 3.5 and will be removed two minor releases later.

Suggested Improvement

It would be good to know what other attribute to use instead of cbar.patch in order to do things like control interaction. It would be nice if the emitted warning and API notes were updated, but at least one or the other would help.

Activity

  1. jklymak commented on Jul 12, 2021

    @jklymak
    Member

    Cbar.ax.figure should work.

  2. larsoner commented on Jul 12, 2021

    @larsoner
    ContributorAuthor

    Ahh yes, that's true in my case because I want the figure anyway. Feel free to close, or leave open if you think it's worth adding a note about how the patch properties might otherwise be modified (since it's possible people might be using cbar.patch somehow that way, too?)

  3. jklymak commented on Jul 12, 2021

    @jklymak
    Member

    The patch really wasn't doing anything, so it's hard to know what message would be helpful in general.

    Btw thanks a lot for testing master!

  4. added this to the v3.5.0 milestone on Jul 24, 2021
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