-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Blue plot #5303
Comments
Yes, the blue is fairly distracting here, and I think we should do the same thing we do in Datashader, which is to make a distinction between no data (zero counts show up transparent) and data (non-zero counts are mapped to the colorbar). Bokeh has options for this, but I can't seem to make them work: import pandas as pd, numpy as np, holoviews as hv
hv.extension('bokeh')
taxi_dropoffs = {hour:arr for hour, arr in np.load('../assets/hourly_taxi_data.npz').items()}
bounds = (-74.05, 40.70, -73.90, 40.80)
image = hv.Image(taxi_dropoffs['0'], ['lon','lat'], bounds=bounds)
image.opts(width=450, tools=['hover'], clipping_colors={'NaN': 'transparent'}, colorbar=True)
image image.opts(nodata=0) image.data = np.where(image.data == 0, np.nan, image.data)
image We'd want it to look like the last image here, but to get that to work I had to manipulate the NumPy array directly; shouldn't it work to just specify |
This works without manipulating the array directly |
Thanks! @jlstevens , any idea how |
|
The question is how to make the zeros in the image map to NaNs;
|
Ah, that's it: the data is float32, with "0." instead of "0". I would have thought
It's slightly annoying that the hover shows NaN instead of 0, but I guess Bokeh is just filling with NaNs internally. |
Ok, I am remembering this now... I think we decided to focus on counts as those are integers (the main use case) and comparing floats is always tricky. I assume the floats here are due to the way the data is stored, because otherwise I would expect integers (unless this is using a mean aggregator for instance). |
Right. I don't know where this data came from, but it does seem like it should have been |
This is fixed on http://dev.holoviews.org/getting_started/Introduction.html and should appear on the main site when the docs are rebuilt on release. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Noticed a blue plot on the holoviews documentation page here. It could be related to holoviz/datashader#1051.
The text was updated successfully, but these errors were encountered: