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

xray.plot.contour doesn't handle colors kwarg correctly #537

Closed
rabernat opened this issue Aug 18, 2015 · 2 comments · Fixed by #538
Closed

xray.plot.contour doesn't handle colors kwarg correctly #537

rabernat opened this issue Aug 18, 2015 · 2 comments · Fixed by #538

Comments

@rabernat
Copy link
Contributor

I found this while playing around with the plotting functions. (Really nice work btw @clarkfitzg!) I know the plotting is still under heavy development, but I thought I would share this issue anyway. I might take a crack at fixing it myself...

The goal is to make an unfilled contour plot with no colors. In matplotlib this is easy

x, y = np.arange(20), np.arange(20)
xx, yy = np.meshgrid(x, y)
f = np.sqrt(xx**2 + yy**2)
plt.contour(x, y, f, colors='k')

If I try the same thing in dask

da = xray.DataArray(f, coords={'y': y, 'x': x})
plt.figure()
xray.plot.contour(da, colors='k')

I get ValueError: Either colors or cmap must be None.

I can't find any way around this (e.g. adding a cmap=None argument has no effect). If I remove the colors keyword, it works and makes colored contours, as expected.

I think this could be fixed easily if you agree it is a bug...

@rabernat rabernat changed the title xray.plot.contour doesn't handle with colors kwarg correctly xray.plot.contour doesn't handle colors kwarg correctly Aug 18, 2015
rabernat added a commit to rabernat/xarray that referenced this issue Aug 18, 2015
@shoyer
Copy link
Member

shoyer commented Aug 18, 2015

Agreed, this seems like something we should fix. Help would definitely be appreciated!

@clarkfitzg
Copy link
Member

@rabernat Thanks!

rabernat added a commit to rabernat/xarray that referenced this issue Aug 26, 2015
rabernat added a commit to rabernat/xarray that referenced this issue Aug 26, 2015
rabernat added a commit to rabernat/xarray that referenced this issue Aug 31, 2015
fixed seaborn dependency in cmap generation

test for new contour color rules
rabernat added a commit to rabernat/xarray that referenced this issue Aug 31, 2015
fixed seaborn dependency in cmap generation

test for new contour color rules

updated docs

test for seaborn palettes
rabernat added a commit to rabernat/xarray that referenced this issue Aug 31, 2015
fixed seaborn dependency in cmap generation

test for new contour color rules

updated docs

test for seaborn palettes

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

Successfully merging a pull request may close this issue.

3 participants