swev-id: matplotlib__matplotlib-23314 | mplot3d: Axes3D should honor set_visible(False)#31
Open
rowan-stein wants to merge 1 commit intomatplotlib__matplotlib-23314from
Open
Conversation
…ased visibility test\n\nFixes #29.\n\n- Add early return in Axes3D.draw when Axes is not visible, mirroring 2D Axes.\n- Add unit test ensuring left 3D axes renders nothing when set_visible(False).\n\nTask 264 — matplotlib__matplotlib-23314
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.
Task 264 — matplotlib__matplotlib-23314
Summary
ax.set_visible(False).Axes3D.draw()whennot self.get_visible(), mirroring 2D Axes behavior.Linked issue
Reproduction (from report)
Observed failure
ax1.set_visible(False).Expected
Root cause (research)
Axes3D.draw()(lib/mpl_toolkits/mplot3d/axes3d.py) drew the background patch and axis panes before callingsuper().draw(renderer)and did not checkAxes.visiblefirst. In contrast, 2DAxes.draw()returns early when invisible.Fix details
Axes3D.draw(self, renderer), add:Test added
lib/mpl_toolkits/tests/test_mplot3d_visibility.pyset_visible(False), draws with Agg, and asserts the left half contains only background pixels.Notes