-
-
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
Hexbin for holoviews #1141
Comments
@ResidentMario You are right, thanks. I edited my original request. |
HoloViews does have seaborn interface classes and I don't see any reason hexbin shouldn't be supported there ( @philippjfr can tell you more about our seaborn support). Getting similar support in the bokeh backend is likely to be a much more substantial challenge as we would probably need to use another third party library or wait for bokeh to support this type of plot. |
Actually matplotlib ships with a hexbin plot by default, see: http://matplotlib.org/examples/pylab_examples/hexbin_demo.html We could fairly easily use the matplotlib version to compute the hexbins and then render those with bokeh but that would obviously mean it would that also depends on matplotlib but I suppose that's better than implementing it all ourselves or depending on other libraries like seaborn. |
As far as I can see the only improvement that seaborn offers over the mpl version is the marginal histograms, but that would be better handled by HoloViews' own adjoint plots, right? Note that the original request doesn't specify bokeh or mpl, just asks that we support it. If wrapping mpl's version is simple, it seems reasonable to do, particularly if its absence would make people unable to use HoloViews in their work. |
Here's initial prototypes for both the matplotlib and bokeh implementations: https://anaconda.org/philippjfr/hexbins/notebook This will need some more discussion though because since aggregation doesn't happen until plotting there is no way to normalize the color range automatically. If we had a more efficient representation for patches I'd consider storing it that way and making hexbin an operation, but I'm also considering something similar to the HeatMap element, which holds both the raw and the aggregated gridded data. The plot looks just at the aggregated data but you can apply all the usual slicing and other methods to the underlying raw data because these methods will create clones which will recompute the aggregated view. That's also problematic though because then we depend on matplotlib to do the hexagonal aggregation and the Element can't be created without it. Not sure what the best thing to do is yet. |
For reference the meat of the matplotlib hexbin implementation is here. If it is possible to make it much shorter/simpler we might want to consider adding the code to utils instead of unpacking a matplotlib hexbin plot as in |
Now merged. |
Oh cool! Time to play with holoviews again. 😄 |
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. |
It would be nice to have a HoloViews equivalent of the
hexbin
package ( https://github.com/edzer/hexbin ), which is an extension package originally made forR
. This provides binning and plotting functions for hexagonal bins and is an alternative to the point/scatter plot. Its main feature/advantage compared to the conventional scatter plot is the ability to give a better visual feedback of the density of the points.(edit)
Existing implementations for python packages:
It seems to already have an interface to
rbokeh
, see:http://ryanhafen.com/blog/plot-lots-of-data
https://rdrr.io/cran/rbokeh/man/ly_hexbin.html
The text was updated successfully, but these errors were encountered: