Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

How to create hexbin plot


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:

There’s nothing in 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.

@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.


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!

@Khreas @sschneider I called matplotlib plt.hexbin() and converted the returned PolyCollection to Plotly shapes


if I am trying to create a hexbin plot similar to this one:

but my raw data for the scatter takes the form of integers, i.e. [0,3] or [2,2] would be a coordinate. Do i first need to normalize the data into “hexbins” which will provide the interlocking pattern as shown in the linked chart?



Hexbin plot is destinated to estimating bivariate continuous distributions or your data are samples from a discrete one.

ok - will take a look at the matplotlib implementation. i have continuous distributions but i had already binned them into discrete (1x1) “buckets”. will explore. thanks!