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

Bar and box plots use the 'default' matplotlib colormap, even if the style is changed #5851

Closed
halflings opened this issue Jan 14, 2016 · 5 comments

Comments

@halflings
Copy link

I originally thought this was an issue with pandas ( pandas-dev/pandas#12029 ), but I can reproduce it by using matplotlib alone.

After changing the style to "fivethirtyeight" (with pyplot.style.use("fivethirtyeight") ) and changing the default colormap (via rcParams), both bar plots and boxplots still use the default colors:

plt.plot([0, 1, 2, 3], [5, 6, 7, 8])
plt.plot([0, 1, 2, 3], [6, 3, 7, 12], alpha=0.5)

lineplot

plt.bar([0, 1, 2, 3], [5, 6, 7, 8])
plt.bar([0, 1, 2, 3], [6, 3, 7, 12], alpha=0.5)

barplot

plt.boxplot([6, 3, 7, 12, 20, 25, 33])

boxplot

The code I used to customize the plotting style can be found on the pandas issue (like I said, it's mostly just setting the style to fivethirtyeight then changing the color cycle)

@mdboom
Copy link
Member

mdboom commented Jan 14, 2016

I think this is fixed by #5598 #5593.

@halflings
Copy link
Author

Great!

Seems like the pandas people did a work around to fix this ( pandas-dev/pandas#11865 ), I hope both fixes won't conflict with each other :)

@jenshnielsen
Copy link
Member

@mdboom I remember that we talked about this issue sometime back but Is that the right PR? It only related to mplot3d as far as I can see

@mdboom
Copy link
Member

mdboom commented Jan 14, 2016

Sorry -- I mistyped the PR number. It's #5593.

@halflings
Copy link
Author

Since it seems like this was addressed previously, closing the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants