home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 101716715

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
101716715 MDU6SXNzdWUxMDE3MTY3MTU= 537 xray.plot.contour doesn't handle colors kwarg correctly 1197350 closed 0     2 2015-08-18T18:11:55Z 2015-09-01T17:20:55Z 2015-09-01T17:20:55Z MEMBER      

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

python 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

python 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...

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/537/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 0.652ms · About: xarray-datasette