plotting: subplots_adjust prevents use of constrained_layout=True · Issue #25261 · pandas-dev/pandas (original) (raw)
Code Sample, a copy-pastable example if possible
Your code here
import matplotlib.pyplot as plt import pandas as pd
fig, axes = plt.subplots(2, constrained_layout=True) times = pd.date_range(start='now', periods=10) pd.DataFrame({'a': np.arange(10)}, index=times).plot(style='x', ax=axes[0])
Problem description
Plotting time-series uses pandas-internally a subplots_adjust, but due to this I am unable to use the new matplotlib constrained_layout that would take care of these things automatically.
Expected Output
A good layout that respects my constrained_layout setting to plt.subplots()
Output of pd.show_versions()
[paste the output of pd.show_versions()
here below this line]
INSTALLED VERSIONS
commit: None
python: 3.7.1.final.0
python-bits: 64
OS: Linux
OS-release: 3.10.0-862.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.1
pytest: 4.2.0
pip: 19.0.2
setuptools: 40.7.3
Cython: 0.29.5
numpy: 1.16.1
scipy: 1.2.0
pyarrow: None
xarray: 0.11.3
IPython: 7.1.1
sphinx: 1.8.4
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.3
lxml.etree: 4.3.1
bs4: None
html5lib: None
sqlalchemy: 1.2.17
pymysql: None
psycopg2: 2.7.7 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None