Skip to content

look for colormap in rcParams['axes.prop_cycle'] (mpl 1.5+) first #11865

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

Merged
merged 1 commit into from
Dec 25, 2015

Conversation

rcarneva
Copy link
Contributor

Fixes #11614

@TomAugspurger
Copy link
Contributor

Thanks!

Could you add a test and a release note? The test should ensure that the colors of the bar patches are correct.

@TomAugspurger TomAugspurger added the Visualization plotting label Dec 18, 2015
@TomAugspurger TomAugspurger added this to the 0.18.0 milestone Dec 18, 2015
@rcarneva
Copy link
Contributor Author

Added a new test with both a passed colormap and one set through mpl's rcParams. What do I need to do to add a release note?

@TomAugspurger
Copy link
Contributor

For the release note add a line in doc/source/whatsnew/v0.18.0 under the bug fixes heading.

def test_rcParams(self):
color_tuples = [(0.9, 0, 0, 1), (0, 0.9, 0, 1), (0, 0, 0.9, 1)]
try:
mpl.rcParams["axes.prop_cycle"] = mpl.cycler("color", color_tuples)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to be careful not to modify rcParams for the rest of the tests. Can't look right now, but I think we or matplotlib have a contextmanager that handles this. @sinhrks do you remember? Also you can move this to tpandas/tools/tests/test_graphics.py and add it to one of the test classes in there.

@rcarneva
Copy link
Contributor Author

I think it's good to go, though looks like I forgot to pull in the most recent changes to the release notes before adding my change... oops. Let me know if there's anything else that needs doing.

@jorisvandenbossche
Copy link
Member

@rcarneva Can squash the commits? (http://pandas-docs.github.io/pandas-docs-travis/contributing.html#combining-commits) For the rest this looks good I think!

@rcarneva rcarneva force-pushed the master branch 4 times, most recently from 83cf990 to 26921b0 Compare December 24, 2015 20:37
@rcarneva
Copy link
Contributor Author

Thanks for the help with this, @TomAugspurger and @jorisvandenbossche

@TomAugspurger
Copy link
Contributor

I'm going to merge this now. I think it has the same problem that all of our compatibility code for mpl 1.5 has: what if the user has a prop_cycle where color isn't in the cycler? May need to look into that if it's something matplotlib tries to support.

Thanks @rcarneva!

TomAugspurger pushed a commit that referenced this pull request Dec 25, 2015
look for colormap in rcParams['axes.prop_cycle'] (mpl 1.5+) first
@TomAugspurger TomAugspurger merged commit 03ee0c1 into pandas-dev:master Dec 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants