-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
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
The setting xrot=0 in DataFrame.hist() doesn't work with by and subplots #30288
Comments
pandas/pandas/plotting/_matplotlib/hist.py Line 253 in 0cd388f
should probably be if xrot is None:
xrot = rot since 0 evaluates to False. A PR fixing that + adding a test would be welcome. |
Hi, Can I do it? |
I am taking this as no one seems to be working on this. |
take |
Looks like pandas/pandas/plotting/_matplotlib/core.py Line 1208 in f505b74
self.rot=0 solves the problem. I will add a PR on this. Also @TomAugspurger the solution you said fixes another issue. Should I add that in the same PR or create another issue on this?
|
thanks for working on it! and i do think if you follow @TomAugspurger 's suggestion, should be able to fix the bug. |
I tried that but it's not working. Looks like pandas/pandas/plotting/_matplotlib/hist.py Line 250 in 0cd388f
|
I have my doubt but I think the following is the problem. pandas/pandas/plotting/_matplotlib/core.py Line 1199 in f505b74
So, when rot argument is not present in dataframe.plot then it is rotated 30deg. So should I update the condition @TomAugspurger @charlesdong1991 ?
|
emm, okay, it seems indeed if both Regarding your question: I did not look at the codebase, but my assumption is when using Just follow your investigation, and you could either submit a PR or open a new issue if you think there is another bug. @souvik3333 |
Oh, actually this bug will be fixed as @TomAugspurger said. I misplaced it with another bug I found. My apologies. I will add a new issue on that bug and add a PR on this shortly. |
…ndexing-1row-df * upstream/master: (333 commits) CI: troubleshoot Web_and_Docs failing (pandas-dev#30534) WARN: Ignore NumbaPerformanceWarning in test suite (pandas-dev#30525) DEPR: camelCase in offsets, get_offset (pandas-dev#30340) PERF: implement scalar ops blockwise (pandas-dev#29853) DEPR: Remove Series.compress (pandas-dev#30514) ENH: Add numba engine for rolling apply (pandas-dev#30151) [ENH] Add to_markdown method (pandas-dev#30350) DEPR: Deprecate pandas.np module (pandas-dev#30386) ENH: Add ignore_index for df.drop_duplicates (pandas-dev#30405) BUG: The setting xrot=0 in DataFrame.hist() doesn't work with by and subplots pandas-dev#30288 (pandas-dev#30491) CI: Fix GBQ Tests (pandas-dev#30478) Bug groupby quantile listlike q and int columns (pandas-dev#30485) ENH: Add ignore_index for df.sort_values and series.sort_values (pandas-dev#30402) TYP: Typing hints in pandas/io/formats/{css,csvs}.py (pandas-dev#30398) BUG: raise on non-hashable Index name, closes pandas-dev#29069 (pandas-dev#30335) Replace "foo!r" to "repr(foo)" syntax pandas-dev#29886 (pandas-dev#30502) BUG: preserve EA dtype in transpose (pandas-dev#30091) BLD: add check to prevent tempita name error, clsoes pandas-dev#28836 (pandas-dev#30498) REF/TST: method-specific files for test_append (pandas-dev#30503) marked unused parameters (pandas-dev#30504) ...
Code Sample, a copy-pastable example if possible
Problem description
The setting
xrot=0
doesn't work when I use the optionby
in DataFrame.hist() (see the screenshot below). The temporary workaround is to set it to a very small value likexrot=0.001
.Expected Output
Should look like this instead
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 3.10.0-1062.4.1.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.25.2
numpy : 1.17.2
pytz : 2019.3
dateutil : 2.8.0
pip : 19.3.1
setuptools : 41.4.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 : 2.10.3
IPython : 7.8.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : 3.0.2
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: