Skip to content

facetgrid: unset cmap if colors is specified. #1928

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
Mar 6, 2018

Conversation

dcherian
Copy link
Contributor

This seemed the cleanest way to fix this. If both colors and cmap are specified, raise an error. If colors is specified and cmap was None, I set the auto-inferred cmap to None.

@@ -221,6 +221,14 @@ def map_dataarray(self, func, x, y, **kwargs):
self : FacetGrid object

"""

cmapkw = kwargs['cmap'] if 'cmap' in kwargs else None
colorskw = kwargs['colors'] if 'colors' in kwargs else None
Copy link
Member

Choose a reason for hiding this comment

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

Use get here, e.g., kwargs.get('cmap').

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, that's a great feature.

@dcherian dcherian force-pushed the fix/colors-over-cmap branch from 99b9cac to 08bdb20 Compare February 27, 2018 19:12
@dcherian dcherian force-pushed the fix/colors-over-cmap branch from 08bdb20 to f02b90b Compare February 27, 2018 19:13
@dcherian
Copy link
Contributor Author

Rebased and squashed.

@shoyer shoyer merged commit 3419e9e into pydata:master Mar 6, 2018
@shoyer
Copy link
Member

shoyer commented Mar 6, 2018

Thanks!

@dcherian dcherian deleted the fix/colors-over-cmap branch May 10, 2018 05:12
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

Successfully merging this pull request may close these issues.

Bug: Faceting fails with levels (easy to fix)
3 participants