Skip to content

BUG: MatplotlibDeprecationWarning is_last_row function was deprecated in Matplotlib 3.4  #42791

Closed
@yinhm

Description

@yinhm

Seeing this warning while using

pyfolio.create_returns_tear_sheet(stock_rets)
.../lib/python3.8/site-packages/pandas/plotting/_matplotlib/tools.py:418: MatplotlibDeprecationWarning: 
The is_last_row function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use ax.get_subplotspec().is_last_row() instead.
  if ax.is_last_row():
.../lib/python3.8/site-packages/pandas/plotting/_matplotlib/tools.py:418: MatplotlibDeprecationWarning: 
The is_last_row function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use ax.get_subplotspec().is_last_row() instead.
  if ax.is_last_row():

change tools.py:418 as suggested did fix the warning.

            except IndexError:
                # if gridspec is used, ax.rowNum and ax.colNum may different
                # from layout shape. in this case, use last_row logic
                for ax in axarr:
                    if ax.get_subplotspecis_last_row():
                        continue
                    if sharex or _has_externally_shared_axis(ax, "x"):
                        _remove_labels_from_axis(ax.xaxis)

Metadata

Metadata

Assignees

Labels

Compatpandas objects compatability with Numpy or Python functionsDependenciesRequired and optional dependenciesVisualizationplotting

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions