Add sort_columns parameter to plot to allow unsorted plots by danbirken · Pull Request #918 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation3 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
I was using pandas for the first time and when plot()ing I noticed it was sorting the columns alphanumerically.
I felt like the ordering I had defined in the DataFrame was a pretty decent proxy for how I wanted the subplots to be ordered, so I think this should be an option so I can over-ride the sorting and have the plot go in the direction specified.
Looks good to me, but as it touches the API I'll let Wes have a look. Thanks for the pull req
wesm added a commit that referenced this pull request
Add sort_columns parameter to plot to allow unsorted plots
Awesome!
Also I didn't want to push my luck too much, but is there a reason that the default is sorting columns in a plot? It certainly is a nice feature to have and I imagine for a lot of datasets it is a really helpful feature, but as a first time user it was strange to me that my plots were showing up in a different order than they were in my dataframe, especially given how wonderfully easy it is to re-order and take subsets of a dataframe.