Skip to content

Commit 663929e

Browse files
Backport PR #42803: COMPAT: MPL 3.4.0 (#42807)
Co-authored-by: Thomas Li <[email protected]>
1 parent 5df103c commit 663929e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/plotting/_matplotlib/tools.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,12 @@ def handle_shared_axes(
414414
except IndexError:
415415
# if gridspec is used, ax.rowNum and ax.colNum may different
416416
# from layout shape. in this case, use last_row logic
417+
if compat.mpl_ge_3_4_0():
418+
is_last_row = lambda x: x.get_subplotspec().is_last_row()
419+
else:
420+
is_last_row = lambda x: x.is_last_row()
417421
for ax in axarr:
418-
if ax.is_last_row():
422+
if is_last_row(ax):
419423
continue
420424
if sharex or _has_externally_shared_axis(ax, "x"):
421425
_remove_labels_from_axis(ax.xaxis)

0 commit comments

Comments
 (0)