From 961418d5298094dc762b04bf9c90839cb2b551f4 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Thu, 5 Mar 2020 08:18:13 +0000 Subject: [PATCH] VIZ: Fixing Matplotlib depecation warnings for ax.rowNum and ax.colNum --- pandas/plotting/_matplotlib/tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pandas/plotting/_matplotlib/tools.py b/pandas/plotting/_matplotlib/tools.py index 5743288982da4..1951f7dea2de8 100644 --- a/pandas/plotting/_matplotlib/tools.py +++ b/pandas/plotting/_matplotlib/tools.py @@ -295,13 +295,19 @@ def _handle_shared_axes(axarr, nplots, naxes, nrows, ncols, sharex, sharey): # so that we can correctly handle 'gaps" layout = np.zeros((nrows + 1, ncols + 1), dtype=np.bool) for ax in axarr: - layout[ax.rowNum, ax.colNum] = ax.get_visible() + layout[ + ax.get_subplotspec().rowspan.start, + ax.get_subplotspec().colspan.start, + ] = ax.get_visible() for ax in axarr: # only the last row of subplots should get x labels -> all # other off layout handles the case that the subplot is # the last in the column, because below is no subplot/gap. - if not layout[ax.rowNum + 1, ax.colNum]: + if not layout[ + ax.get_subplotspec().rowspan.start + 1, + ax.get_subplotspec().colspan.start, + ]: continue if sharex or len(ax.get_shared_x_axes().get_siblings(ax)) > 1: _remove_labels_from_axis(ax.xaxis)