kuva hexbin

Hexagonal-bin density plot from two numeric columns.

Input: two numeric columns (x and y); optionally a third column for z aggregation.

FlagDefaultDescription
--x <COL>0X-axis column (name or index)
--y <COL>1Y-axis column (name or index)
--z <COL>Third variable column for aggregation-based coloring
--reduce <FUNC>countAggregation for z: count, mean, sum, median, min, max
--n-bins <N>20Number of hex columns across the x-axis
--log-coloroffLog₁₀ color scale — compresses high-count peaks
--min-count <N>1Suppress bins with fewer than N points
--normalizeoffDivide counts by total points (fractional density)
--flat-topoffFlat-top hex orientation instead of pointy-top
--stroke <COLOR>Hex outline color (CSS string, e.g. "#333333")
--colormap <NAME>viridisColor map: viridis, inferno, turbo, grayscale
--no-colorbaroffHide the colorbar
# Basic density plot from two columns
kuva hexbin data.tsv --x x --y y

# More bins for finer structure
kuva hexbin data.tsv --x x --y y --n-bins 40

# Log scale — reveals sparse structure around a dense core
kuva hexbin data.tsv --x x --y y --log-color

# Suppress peripheral noise — only render bins with ≥5 points
kuva hexbin data.tsv --x x --y y --min-count 5

# Fractional density (0–1 scale)
kuva hexbin data.tsv --x x --y y --normalize

# Color by mean of a third variable
kuva hexbin data.tsv --x x --y y --z value --reduce mean

# Flat-top orientation with Inferno colormap
kuva hexbin data.tsv --x x --y y --flat-top --colormap inferno

# Add hex outlines
kuva hexbin data.tsv --x x --y y --stroke "#444444"

See also: Shared flags — output, appearance, axes, log scale.