-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Regrid doc elaboration for image data #3911
Conversation
Thanks a lot for this clarification.
This is because I'd suggest you use |
@philippjfr Thanks for the info!
Ah, that makes sense. So right now it is not possible to control the colormap range in a plot created from
Hmm, doesn't that mean that my explanation is incorrect then? I wrote: "When working with already gridded data, such as images, it is not always necessary to perform the rasterization/aggregation step", but since you suggest to use Is there any performance penalty associated with using |
It is, I think you should be able to pass
Yes, sorry should have commented, I'll try to think of some clearer wording. This is definitely something quite a few people have been confused about so we should definitely try to get it across as clearly as possible.
Possibly but very minor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!. I made edits to avoid the use of regrid
, which as @philippjfr suggests isn't normally called by users, as regrid
is precisely the same as rasterize
when used for images, and there's no need for people to learn the specialized name since rasterize
does it all.
when I try to do this I get an error:
That error is accurate; supporting span
(the datashader equivalent of clim
is indeed not yet supported for eq_hist
; it would take some special work to figure out how to map those limits onto the variably spaced color scale created by eq_hist
). Doable, but not yet done by anyone.
In the meantime, you can avoid the issue either by using rasterize
rather than datashade
, or by changing the datashade
/shade
normalization to something other than eq_hist
(log
, linear
, etc.).
The GIF is useful. For now, maybe just embed it like any other image, directly in the Markdown? We're still working out some general way to show output as GIFs while not confusing notebook users with double output. |
We generally upload gifs to assets.holoviews.org and link to them, I would not suggest embedding a base64 encoded gif in markdown. If you think we should do that I'm happy to upload the gif and will paste the link to it here. |
|
Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
Great, thank you both for the comments! I made updates accordingly. I think the only thing missing now is the gif. Thanks for the explanation regarding clims with datashade. I think that could be clarified in the error message, for example changing from:
to
or even automatically changing to lin or log and print a warning which the user can silence by explicitly setting the parameter. |
Co-Authored-By: Philipp Rudiger <prudiger@anaconda.com>
Here's a permanent link to the gif: http://assets.holoviews.org/gifs/guides/user_guide/Large_Data/rasterize_color_range.gif |
@philippjfr Thanks, should I suppress the notebook output somehow so that there is not a double plot showing up? |
I'll leave that up to you but that seems like a reasonable solution until we figure out a more general one (as @jbednar mentioned this is a recurring problem in a lot of our docs/notebooks). |
I included the gif and made one last change to include the earlier comment from @jbednar which I found helpful to understand the differences in shading/colormapping between rasterize and datashade. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for contributing!
Thanks for helping me contribute! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi @jbednar I am following up on your SO comment to add to the documentation what I think could be helpful to understand datashading operations on image data with the
clim
option.I added a short paragraph which reflects my current understanding of the topic (which is likely incomplete) and a short example to show the difference between automatic color range rescaling and how to fix the range. Since the rescaling will not show up in the static documentation I also made this gif, but not sure what the policy is for including images vs the notebook output.
One thing I still find somewhat confusing is that the
datashade()
function doesn't seem to be able to pass.opts(clim=())
onto the bokeh backend (likeregrid
does). Instead I can passclims=()
directly to thedatashade()
function, but when I try to do this I get an error: