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

plot: If provided with colormap do not modify it. #2935

Merged
merged 18 commits into from
May 9, 2019

Conversation

dcherian
Copy link
Contributor

@dcherian dcherian commented May 2, 2019

If provided a Colormap we don't override it anymore. facetgrid determines a colormap first and passes that down, so this prevents overwriting.

@pep8speaks
Copy link

pep8speaks commented May 2, 2019

Hello @dcherian! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-05-09 16:19:49 UTC

@@ -4,12 +4,10 @@
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_array_equal
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lint fixes

@mathause
Copy link
Collaborator

mathause commented May 2, 2019

Thanks for the PR, however this did not work for the minimal example @lvankampenhout provided because isinstance(mpl.colors.ListedColormap, mpl.colors.Colormap) returns False (and you get a ListedColormap when specifying levels).

@dcherian
Copy link
Contributor Author

dcherian commented May 2, 2019

🤦‍♂️ Thanks @mathause. I was too sleepy I guess.

The example now works; but the test doesn't work. It should fail for cmap='RdBu_r' but doesn't locally. Any suggestions would be helpful

@dcherian
Copy link
Contributor Author

dcherian commented May 2, 2019

Never mind; should be all good now.

Copy link
Member

@fmaussion fmaussion left a comment

Choose a reason for hiding this comment

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

Looks OK to me!

xarray/plot/utils.py Outdated Show resolved Hide resolved
dcherian and others added 9 commits May 3, 2019 07:28
* 'fix/2932' of github.com:dcherian/xarray:
  whats-new under bugfixes
why is this needed?
* 'fix/2932' of github.com:dcherian/xarray:
  @requires_matplotlib
* upstream/master:
  [WIP] Custom fill value for reindex, align, and merge operations (pydata#2920)
  Attempt to fix py35 build on Travis (pydata#2925)
  List formatting in docs (pydata#2939)
  DOC: Avoid downloading .tif file (pydata#2919)
@dcherian
Copy link
Contributor Author

dcherian commented May 6, 2019

Failed test is #2940. I'll merge in a few days if no one else has any comments

@dcherian dcherian merged commit ab39722 into pydata:master May 9, 2019
@dcherian dcherian deleted the fix/2932 branch May 9, 2019 16:19
dcherian added a commit to dcherian/xarray that referenced this pull request Jun 21, 2019
@dcherian dcherian mentioned this pull request Jun 21, 2019
shoyer pushed a commit that referenced this pull request Jun 22, 2019
* Test for levels + provided cmap

* Revert "plot: If provided with colormap do not modify it. (#2935)"

This reverts commit ab39722.

* lint
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.

Facetgrid: colors beyond range (extend) not saturated
4 participants