plot point
Draws a scatter plot, line chart, or path chart in the terminal.
Behavior:
- Maps TSV columns to visual aesthetics (position, color).
- Supports scatter plots (default), line charts (
--line), or path charts (--path). - Supports overlaying linear regression lines (
--regression). --regressioncannot be used with--lineor--path.
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 an ASCII/Unicode chart to standard output.
- Chart dimensions can be controlled with
--colsand--rows.
Chart types:
- Scatter plot (default): Individual points without connecting lines.
--line/-l: Connect points with lines, sorted by X value (good for trends).--path: Connect points with lines, preserving original data order (good for trajectories).--regression/-r: Overlay linear regression line (least squares fit). Cannot be used with--lineor--path.
Examples:
-
Basic scatter plot
tva plot point data.tsv -x age -y income -
Grouped by category
tva plot point iris.tsv -x petal_length -y petal_width --color label -
Line chart (sorted by X, good for trends)
tva plot point timeseries.tsv -x time -y value --line --cols 100 --rows 30 -
Path chart (preserves data order, good for trajectories)
tva plot point trajectory.tsv -x x -y y --path --cols 100 --rows 30 -
With regression line (linear fit)
tva plot point iris.tsv -x sepal_length -y petal_length --regression -
Using column indices
tva plot point data.tsv -x 1 -y 3 --color 5 -
Multiple Y columns
tva plot point data.tsv -x time -y value1,value2