Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make annotate/OffsetFrom unaffected by later mutation of coordinates. #26466

Merged
merged 1 commit into from Aug 7, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 7, 2023

The unpacking (x, y = xy) is safe wrt. units (we already perform the same unpacking later when actually computing coordinates) and prevents later mutation of the input array from affecting the artist (or the OffsetFrom instance), which is consistent with other artists.

While at it, also inline OffsetFrom._get_scale, which is a one-liner.

Closes #17566; supersedes #17567.

PR summary

PR checklist

The unpacking (`x, y = xy`) is safe wrt. units (we already perform the
same unpacking later when actually computing coordinates) and prevents
later mutation of the input array from affecting the artist (or the
OffsetFrom instance), which is consistent with other artists.

While at it, also inline OffsetFrom._get_scale, which is a one-liner.
@ksunden ksunden added this to the v3.8.0 milestone Aug 7, 2023
@ksunden ksunden merged commit 2cbb3e0 into matplotlib:main Aug 7, 2023
39 of 40 checks passed
@anntzer anntzer deleted the coordcopy branch August 7, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating an array passed as the xy parameter to annotate updates the anottation
3 participants