FIX: Handle hidden annotations during deletion in mpl plot#13703
Open
DerAndereJohannes wants to merge 1 commit intomne-tools:mainfrom
Open
FIX: Handle hidden annotations during deletion in mpl plot#13703DerAndereJohannes wants to merge 1 commit intomne-tools:mainfrom
DerAndereJohannes wants to merge 1 commit intomne-tools:mainfrom
Conversation
a085fd5 to
b6a3413
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue
Fixes #13511.
What does this implement/fix?
This pull request fixes an issue in which removing annotations from the raw matplotlib figure would remove additional unintended annotations.
The issue with the current live code is that it assumes that the visible annotations are all grouped together in a continuous block starting from offset. However, this logic does not hold up.
For example, if
is_onscreenis[True, False, True], then the offset is 0. Thereforezorders[0:2]get thevisible_zordersinstead of index 0 and 2.The fix simply masks the zorders using the
is_onscreento assignvisible_zordersto the correct indices.Additional information
I have just implemented the fix here without a new regression pytest. Let me know how I should implement one if it is needed. Thank you!