Menu

Distribution
Static
48 Python scripts generated for hexbin plot this week

Hexbin Plot

Chart overview

A hexbin plot divides the two-dimensional space into a regular grid of hexagonal bins and colors each hexagon according to the number of data points (or a summary statistic) that fall within it.

Key points

  • Hexagons tile the plane more efficiently than squares: they are equidistant from the center to all six neighbors, producing less visual distortion at bin edges and making density gradients appear smoother.
  • This makes hexbin plots the preferred solution for visualizing tens of thousands to millions of points where a conventional scatter plot would be an opaque blob of overplotted marks.
  • In single-cell genomics, hexbin plots display UMAP or t-SNE embeddings density when large atlas-scale datasets are involved.

Example Visualization

Hexbin density plot showing joint distribution of two gene expression measurements from single-cell RNA-seq data

Create This Chart Now

Generate publication-ready hexbin plots with AI in seconds. No coding required – just describe your data and let AI do the work.

View example prompt
Example AI Prompt

"Create a hexbin plot from my large single-cell RNA-seq dataset showing the joint distribution of two gene expression values. Use gridsize=50 and viridis colormap from white (low density) to dark purple (high density). Add a colorbar labeled 'Cell Count'. Overlay contour lines for the 25th, 50th, and 75th density percentiles. Label axes with gene names. Output at 300 DPI for publication."

How to create this chart in 30 seconds

1

Upload Data

Drag & drop your Excel or CSV file. Plotivy securely processes it in your browser.

2

AI Generation

Our AI analyzes your data and generates the Hexbin Plot code automatically.

3

Customize & Export

Tweak the design with natural language, then export as high-res PNG, SVG or PDF.

Python Code Example

Loading code...

Console Output

Output
Figure saved: plotivy-hexbin-plot.png

Common Use Cases

  • 1Single-cell RNA-seq: visualizing co-expression of two marker genes across hundreds of thousands of cells
  • 2Mass spectrometry: displaying m/z vs. retention time feature density for untargeted metabolomics
  • 3High-content imaging phenomics: correlating two morphological features measured from millions of cells
  • 4GWAS: joint density of effect size estimates from two independent GWAS cohorts for genetic correlation

Pro Tips

Choose gridsize based on data density: too coarse loses detail, too fine produces sparse empty hexagons

Use a colormap that starts at white or light yellow for empty areas so background is distinguishable

For log-distributed data, log-transform both axes before binning so density is not dominated by outliers

Add marginal histograms or KDE curves along each axis for additional distributional context

Free Cheat Sheet

Scientific Chart Selection Cheat Sheet

Not sure whether to use a Violin Plot, Box Plot, or Ridge Plot? Download our single-page reference mapping the most-used scientific chart types, exactly when to use them, and the core Matplotlib/Seaborn functions.

Comparison Charts
Distribution Charts
Time Series Data
Common Mistakes
No spam. Unsubscribe anytime.