Publishable Figs Overview Distribution & Group Comparison ↳ Box Plot ↳ Violin Plot ↳ Strip / Jitter Plot ↳ Bar Chart (Mean ± SEM) ↳ Histogram ↳ Dot Plot (Estimation) ↳ 2D Density Contour Correlation & Regression ↳ Scatter Plot ↳ Regression Plot ↳ Bubble Chart ↳ Confidence Ellipse ↳ Bland-Altman Plot Multivariate & Dimensionality ↳ Heatmap ↳ Parallel Coordinates ↳ PCA Biplot ↳ Hierarchical Clustering Clinical & Biomedical ↳ Kaplan-Meier Curve ↳ ROC Curve ↳ Volcano Plot ↳ Forest Plot Composition & Trends ↳ Pie / Donut Chart ↳ Line Chart (Time Series) ↳ Stacked Bar Chart

2D Density Contour

When two continuous variables are measured across groups with large n (n > 100), a scatter plot overplots —points overlap so densely that the actual distribution is invisible. A 2D kernel density contour plot visualizes the joint distribution of both variables simultaneously, with contour levels showing where data density is highest, grouped by a categorical variable using color.

STEP 1 —When to Use

Use a 2D density contour when: n > 100 per group (overplotting prevents readable scatter); you have two continuous variables and a categorical grouping variable; you want to compare the joint distribution shape and overlap between groups (e.g., flow cytometry data, population surveys, large-scale genomic data).

Do not use when: n < 50 per group (individual points are more informative); groups are so distinct that contours do not overlap (a scatter plot with distinct colors is clearer); the two variables are on incommensurable scales without a meaningful joint distribution.

[Image placeholder: Left —scatter plot with n=500 per group, 2 colors. Massive overplotting, distribution invisible. Right —2D KDE contour of the same data. Two overlapping ellipse-like contour groups clearly visible, overlap region highlighted, density peaks labeled. Same data, radically different readability.]
Scatter overplotting at n=500 (left). 2D KDE contour (right) reveals group distribution shapes and overlap clearly.

STEP 2 —Journal Requirement

  • Contour levels must be labeled (e.g., "Contour levels at 25th, 50th, 75th, 90th percentile of each group's density").
  • Bandwidth selection method must be stated (same requirement as for violin plots).
  • n per group must be stated.
  • Color palette must be accessible (colorblind-safe distinction between groups).

STEP 3 —Licklider Implementation

Input

  • Two continuous variables (x and y axes)
  • Categorical grouping variable (color)
  • Bandwidth: MISE-optimal (default), user-specified, or diagonal bandwidth matrix
  • Contour levels: percentile-based (default) or density value-based

Output

  • Contour lines per group with distinct colors (up to 4 groups with accessible palette)
  • Filled contours optional (lowest level filled, others outlined)
  • Marginal density strips on x and y axes (optional)
  • Individual scatter points plotted semi-transparently beneath contours (optional)
  • Bandwidth and contour level definition in legend
[Image placeholder: Licklider 2D density contour with 2 groups (n=280 each). Three contour levels (50th, 75th, 90th percentile density) per group in two colorblind-safe colors. Marginal density strips on both axes. Bandwidth in legend. Both groups' density peaks and overlap region clearly visible.]
Licklider 2D density contour: three contour levels per group, marginal density strips, and bandwidth disclosed in legend.

STEP 4 —Draft Output (Draft / Needs review)

Joint distribution of [X variable] and [Y variable] is shown as 2D kernel
density contours for each group (n = 280 per group). Contour lines represent
the 50th, 75th, and 90th percentile density levels for each group.
Bandwidth was selected using the MISE-optimal plug-in estimator.
Marginal density estimates are shown on each axis. Correlation within
each group: Group A: r = 0.42 (p < 0.001); Group B: r = ~.18 (p = 0.003).