Skip to content

Commit

Permalink
Add hist as test of generalization.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jan 14, 2019
1 parent 6df10c1 commit a12378c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xarray/plot/dataset_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,14 @@ def scatter(ax, ds, x, y, hue, hue_style, **kwargs):
return primitive


@_dsplot
def hist(ds, x, y, hue, hue_style, ax, **kwargs):

cmap_params = kwargs.pop('cmap_params')

xplt, yplt = broadcast(ds[x], ds[y])
_, _, _, primitive = ax.hist2d(ds[x].values.ravel(),
ds[y].values.ravel(),
**cmap_params, **kwargs)

return primitive

0 comments on commit a12378c

Please sign in to comment.