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

Call darray.compute() in plot() #3183

Merged
merged 2 commits into from
Aug 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions xarray/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import numpy as np
import pandas as pd

from ..core.pycompat import dask_array_type
from .facetgrid import _easy_facetgrid
from .utils import (
_add_colorbar, _ensure_plottable, _infer_interval_breaks, _infer_xy_labels,
Expand Down Expand Up @@ -141,6 +142,9 @@ def plot(darray, row=None, col=None, col_wrap=None, ax=None, hue=None,
"""
darray = darray.squeeze()

if isinstance(darray.data, dask_array_type):
darray = darray.compute()
dcherian marked this conversation as resolved.
Show resolved Hide resolved

plot_dims = set(darray.dims)
plot_dims.discard(row)
plot_dims.discard(col)
Expand Down