How to create hexbin plot


#1

Hello!

I’ve come accross the following graph by googling ‘Hexbin plotly’ but I can’t seem to find a reproducible example in the documentation. What kind of graph is it? A ‘hacked’ scatter plot?

Thanks in advance. :slight_smile:


#2

There’s nothing in plotly.py to help make hex-bin plots directly (yet! would love to add a figure factory for this), but perhaps @empet could chime in on how this one was made.
-Jon


#3

@Khreas, @jmmease I’ll look for the notebook where I defined the hexbin plot (two years ago or so), update it to Plotly 3.+ , and upload on Plotly cloud.


#4

Any update on this? I’m trying to figure out how you built the shapes for the hexbin plot, but it seems quite difficult. Would be great to see how that works :slight_smile:

Thanks in advance!


#5

@Khreas @sschneider I called matplotlib plt.hexbin() and converted the returned PolyCollection to Plotly shapes
https://nbviewer.jupyter.org/gist/empet/8e466955c9e30f7471b4fb45c3a0fb21.