We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import pandas as pd import matplotlib.pyplot as plt from io import StringIO csv_string = """x,y1,y2 0, 1, 1 1, 1, 2 2, 1, 3 3, 4, 2 4, 2, 4 5, 3, 3 """ data = pd.read_csv(StringIO(csv_string)) dataframe = pd.DataFrame(data) dataframe.plot(x="x", y=["y1", "y2"], kind="line", subplots=True, sharex=True, marker=",", linewidth=0.5, title="Title" ) plt.show()
The xticks are unnecessarily rotated: Also the title overlaps the subplot, but I will create a new issue for that.
The xticks shouldn't be rotated.
pd.show_versions()
pandas : 0.25.3 numpy : 1.17.3 pytz : 2019.3 dateutil : 2.8.1 pip : 19.3.1 setuptools : 41.6.0 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : None IPython : None pandas_datareader: None bs4 : None bottleneck : None fastparquet : None gcsfs : None lxml.etree : None matplotlib : 3.1.1 numexpr : None odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pytables : None s3fs : None scipy : None sqlalchemy : None tables : None xarray : None xlrd : None xlwt : None xlsxwriter : None import sys; print('Python %s on %s' % (sys.version, sys.platform)) Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
The text was updated successfully, but these errors were encountered:
Thanks @thehalftruth for the report
Seems this only happens when subplots=True
subplots=True
also happens when use_index=False and the index is all dates
use_index=False
notes to self:
historical work was done in pandas/tools/plotting.py. also, see #8301
pandas/tools/plotting.py
Sorry, something went wrong.
MarcoGorelli
Successfully merging a pull request may close this issue.
Code Sample
Problem description
The xticks are unnecessarily rotated:

Also the title overlaps the subplot, but I will create a new issue for that.
Expected Output
The xticks shouldn't be rotated.
Output of
pd.show_versions()
pandas : 0.25.3
numpy : 1.17.3
pytz : 2019.3
dateutil : 2.8.1
pip : 19.3.1
setuptools : 41.6.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
import sys; print('Python %s on %s' % (sys.version, sys.platform))
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
The text was updated successfully, but these errors were encountered: