Skip to content

Commit fa970eb

Browse files
committed
Merge pull request matplotlib#1327 from jenshnielsen/offset_text
plt.subplots: Set the visibility of the offset text to false on the shared axes.
2 parents 1c76af5 + 104c03c commit fa970eb

File tree

6 files changed

+1801
-0
lines changed

6 files changed

+1801
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,7 @@ def tk_window_focus():
10781078
'matplotlib.tests.test_scale',
10791079
'matplotlib.tests.test_simplification',
10801080
'matplotlib.tests.test_spines',
1081+
'matplotlib.tests.test_subplots',
10811082
'matplotlib.tests.test_text',
10821083
'matplotlib.tests.test_ticker',
10831084
'matplotlib.tests.test_tightlayout',

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,13 +978,15 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
978978
for ax in axarr[:-1, :].flat:
979979
for label in ax.get_xticklabels():
980980
label.set_visible(False)
981+
ax.xaxis.offsetText.set_visible(False)
981982

982983
if sharey in ["row", "all"] and ncols > 1:
983984
#if sharey and ncols>1:
984985
# turn off all but the first column
985986
for ax in axarr[:, 1:].flat:
986987
for label in ax.get_yticklabels():
987988
label.set_visible(False)
989+
ax.yaxis.offsetText.set_visible(False)
988990

989991
if squeeze:
990992
# Reshape the array to have the final desired dimension (nrow,ncol),
Binary file not shown.
24.5 KB
Loading

0 commit comments

Comments
 (0)