Skip to content
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

DEPR: sort_columns in plot #47563

Closed
3 tasks done
PorcelainMouse opened this issue Jul 1, 2022 · 3 comments · Fixed by #48073
Closed
3 tasks done

DEPR: sort_columns in plot #47563

PorcelainMouse opened this issue Jul 1, 2022 · 3 comments · Fixed by #48073
Assignees
Labels
Deprecate Functionality to remove in pandas Visualization plotting

Comments

@PorcelainMouse
Copy link

PorcelainMouse commented Jul 1, 2022

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import numpy as np
import pandas as pd
df1 = pd.DataFrame({
    'a' : np.random.normal(0,1,10),
    'b' : np.random.normal(0,1,10),
)}
df1[['b','a']].plot.box(sort_columns=True)
df1[['b','a']].sort_index(axis=1).plot.box()

Issue Description

Best I can tell, this option just doesn't work. The documentation describes the result of this option as "Sort column names to determine plot ordering." It is clear this means ordering the columns by name, presumably lexically. But, instead, this is what it does:
bug_python_sort

Expected Behavior

I interpret this option to be equivalent to .sort_index(axis=1), which works.

bug_python_sort_workaround

Installed Versions

INSTALLED VERSIONS

commit : e8093ba
python : 3.10.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.18.6-200.fc36.x86_64
Version : #1 SMP PREEMPT_DYNAMIC Wed Jun 22 13:46:18 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.utf8
LOCALE : en_US.UTF-8

pandas : 1.4.3
numpy : 1.22.0
pytz : 2022.1
dateutil : 2.8.1
setuptools : 59.6.0
pip : 21.3.1
Cython : 0.29.26
pytest : 6.2.5
hypothesis : None
sphinx : 4.4.0
blosc : 1.10.6
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.7.1
html5lib : 1.1
pymysql : 1.0.2
psycopg2 : None
jinja2 : 3.0.3
IPython : 8.3.0
pandas_datareader: 0.10.0
bs4 : 4.11.0
bottleneck : 1.3.2
brotli : 1.0.9
fastparquet : 0.8.1
fsspec : 2022.5.0
gcsfs : 2022.5.0
markupsafe : 2.0.0
matplotlib : 3.5.2
numba : None
numexpr : 2.8.1
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : 8.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.8.1
snappy : None
sqlalchemy : 1.4.39
tables : 3.7.0
tabulate : 0.8.10
xarray : 2022.3.0
xlrd : 2.0.1
xlwt : 1.3.0
zstandard : None

@PorcelainMouse PorcelainMouse added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 1, 2022
@phofl phofl added Visualization plotting and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 2, 2022
@phofl
Copy link
Member

phofl commented Jul 2, 2022

Hi, thanks for your report. This is currently ignored completly. Plotly does not support this at all. I think deprecating might make sense here, since this can be easily accomplished beforehand

@phofl phofl added the Needs Triage Issue that has not been reviewed by a pandas team member label Jul 2, 2022
@PorcelainMouse
Copy link
Author

Okay, cool, seems like a reasonable solution. Thanks.

@mroeschke mroeschke added Deprecate Functionality to remove in pandas and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 11, 2022
@mroeschke mroeschke changed the title BUG: plot option sort_columns doesn't work DEPR: sort_columns in plot Aug 11, 2022
@YagoGG
Copy link
Contributor

YagoGG commented Aug 13, 2022

take

YagoGG added a commit to YagoGG/pandas that referenced this issue Aug 13, 2022
YagoGG added a commit to YagoGG/pandas that referenced this issue Aug 14, 2022
YagoGG added a commit to YagoGG/pandas that referenced this issue Aug 14, 2022
YagoGG added a commit to YagoGG/pandas that referenced this issue Aug 14, 2022
YagoGG added a commit to YagoGG/pandas that referenced this issue Aug 14, 2022
mroeschke pushed a commit that referenced this issue Aug 16, 2022
YYYasin19 pushed a commit to YYYasin19/pandas that referenced this issue Aug 23, 2022
noatamir pushed a commit to noatamir/pandas that referenced this issue Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Visualization plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants