-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: remove colorbar from list of colorbars on axes #20980
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
Conversation
I think you might have meant to squash those two commits? |
b49b922
to
950fbac
Compare
Yes, squashed and new test added as a separate commit. |
950fbac
to
3983b39
Compare
post_position = ax.get_position() | ||
np.testing.assert_allclose(pre_position.get_points(), | ||
post_position.get_points()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly add an assert that cb.ax isn't in the ax._colorbars
list since that is the addition you're adding above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that we don't usually check private attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If cb.ax
is still in ax._colorbars
this test will raise with the AttributeError: 'NoneType' object has no attribute 'transSubfigure'
of the original issue. Thats what this test checks, I'm not convinced we need to test the implementation.
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove If these instruction are inaccurate, feel free to suggest an improvement. |
…980-on-v3.5.x Backport PR #20980 on branch v3.5.x (FIX: remove colorbar from list of colorbars on axes)
FIX: remove colorbar from list of colorbars on axes
Closes #20978
If a colorbar was removed it was not being removed from a list of colorbars associated with an axes. This would confuse constrained_layout, as in #20978
test:
This now works...