Skip to content

Pandas enforces subplot_adjust creating UserWarning with constrained_layout #16464

@michaelaye

Description

@michaelaye

Bug report

Bug summary

Pandas dataframe plotting uses subplot_adjust, always creating a UserWarning because I am using constrained_layout as my default layouter.

Cross-issue with pandas-dev/pandas#25261 (I'm uncertain where this should/could be fixed).

Code for reproduction

import matplotlib as mpl
mpl.rcParams['figure.constrained_layout.use'] = True
tseries = pd.date_range('now', freq='s', periods=100)
df = pd.DataFrame({'data': np.random.random(100)}, index=tseries)
df.plot()

Actual outcome

Screenshot 2020-02-10 09 55 00

Expected outcome

No UserWarning

Matplotlib version

  • Operating system: macOS 10.14.6
  • Matplotlib version: 3.1.3
  • Matplotlib backend (print(matplotlib.get_backend())): 'module://ipykernel.pylab.backend_inline'
  • Python version: 3.7.6
  • Jupyter version (if applicable): Jupyterlab 1.2.6
  • Other libraries:

All installed via conda-forge.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions