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

Why are there two compute calls for plot? #2390

Closed
mrocklin opened this issue Aug 29, 2018 · 3 comments · Fixed by #3183
Closed

Why are there two compute calls for plot? #2390

mrocklin opened this issue Aug 29, 2018 · 3 comments · Fixed by #3183

Comments

@mrocklin
Copy link
Contributor

Anecdotally I find that when I call .plot() on a dataset object that holds dask arrays compute gets called twice. Why is this? I'm curious if this is something that should be resolved.

@mrocklin
Copy link
Contributor Author

Sorry, I meant plot.imshow()

@rabernat
Copy link
Contributor

My guess is that this is happening because there is first a call to get the bounds on the data (vmin, vmax).

Does the double compute still happen if you specify vmin and vmax in the call to .plot()?

@shoyer
Copy link
Member

shoyer commented Aug 30, 2018

We should probably call compute() on xarray objects immediately upon entering a plot method. My guess is that this happens because we rely upon coercing with np.asarray() or DataArray.values to get numpy arrays in xarray plotting methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants