Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6db292

Browse files
committed
Only apply axis sharing if axis is visible
1 parent 7a7852f commit c6db292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎proplot/axes/cartesian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def _apply_axis_sharing(self):
318318
# bottommost or to the *right* of the leftmost panel. But the sharing level
319319
# used for the leftmost and bottommost is the *figure* sharing level.
320320
axis = self.xaxis
321-
if self._sharex is not None:
321+
if self._sharex is not None and axis.get_visible():
322322
level = 3 if self._panel_sharex_group else self.figure._sharex
323323
if level > 0:
324324
text._transfer_text(axis.label, self._sharex.xaxis.label)
@@ -329,7 +329,7 @@ def _apply_axis_sharing(self):
329329
axis.set_tick_params(which='both', labelbottom=False, labeltop=False)
330330
# Y axis
331331
axis = self.yaxis
332-
if self._sharey is not None:
332+
if self._sharey is not None and axis.get_visible():
333333
level = 3 if self._panel_sharey_group else self.figure._sharey
334334
if level > 0:
335335
text._transfer_text(axis.label, self._sharey.yaxis.label)

0 commit comments

Comments
 (0)