plot bin2d
Creates a 2D binning heatmap (density plot) of two numeric columns.
Behavior:
- Divides the plane into rectangular bins and counts the number of points in each bin.
- Visualizes the density using character intensity in the terminal.
- Supports automatic bin count strategies or custom bin counts/widths.
- Density scale (low to high):
·≥5% (dark grey)░≥20% (grey)▒≥40% (white)▓≥60% (yellow)█≥80% (red)
- Values below 5% are not shown.
Input:
- Reads from files or standard input.
- Files ending in
.gzare transparently decompressed. - Assumes the first line is a header row with column names.
Output:
- Renders a heatmap to the terminal using character density.
Examples:
-
Basic 2D binning
tva plot bin2d data.tsv -x age -y income -
Specify number of bins
tva plot bin2d data.tsv -x age -y income --bins 20 -
Different bins for x and y
tva plot bin2d data.tsv -x age -y income --bins 30,10 -
Use automatic bin count strategy
tva plot bin2d data.tsv -x age -y income -S freedman-diaconis -
Specify bin width
tva plot bin2d data.tsv -x age -y income --binwidth 5 -
Custom chart size
tva plot bin2d data.tsv -x age -y income --cols 100 --rows 30