Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9d5953f

Browse filesBrowse files
authored
Merge pull request #23314 from QuLogic/fix-invisible-3d
Don't draw invisible 3D Axes
2 parents ba0db3c + 345d4ca commit 9d5953f
Copy full SHA for 9d5953f

File tree

Expand file treeCollapse file tree

3 files changed

+15
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+15
-1
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
# the tests with multiple threads.
4646

4747

48+
@check_figures_equal(extensions=["png"])
49+
def test_invisible_axes(fig_test, fig_ref):
50+
ax = fig_test.subplots()
51+
ax.set_visible(False)
52+
53+
4854
def test_get_labels():
4955
fig, ax = plt.subplots()
5056
ax.set_xlabel('x label')
@@ -7331,7 +7337,7 @@ def test_redraw_in_frame():
73317337
ax.redraw_in_frame()
73327338

73337339

7334-
def test_invisible_axes():
7340+
def test_invisible_axes_events():
73357341
# invisible axes should not respond to events...
73367342
fig, ax = plt.subplots()
73377343
assert fig.canvas.inaxes((200, 200)) is not None

‎lib/mpl_toolkits/mplot3d/axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ def apply_aspect(self, position=None):
387387

388388
@martist.allow_rasterization
389389
def draw(self, renderer):
390+
if not self.get_visible():
391+
return
390392
self._unstale_viewLim()
391393

392394
# draw the background patch

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
image_comparison, remove_text=True, style='default')
2222

2323

24+
@check_figures_equal(extensions=["png"])
25+
def test_invisible_axes(fig_test, fig_ref):
26+
ax = fig_test.subplots(subplot_kw=dict(projection='3d'))
27+
ax.set_visible(False)
28+
29+
2430
def test_aspect_equal_error():
2531
fig = plt.figure()
2632
ax = fig.add_subplot(projection='3d')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.