A terminal UI graph plotter for physics lab data. It works like a small lab notebook plus graph-paper viewer inside the terminal: enter x-y values, edit the table, and see the plot, best-fit equation, slope, intercept, and R^2 update immediately.
The app stores data as plain CSV. No database is required.
On NixOS or any system with Nix:
nix-shell
cargo run -- samples/ohms_law.csvWithout entering a shell:
nix-shell --run "cargo run -- samples/ohms_law.csv"A flake.nix is also included for projects that prefer flakes. In a Git worktree, Nix flakes only see files tracked by Git, so use nix-shell while working with newly created untracked files.
With a normal Rust toolchain:
cargo run -- samples/ohms_law.csvStart without a file to create a blank dataset:
cargo run| Key | Action |
|---|---|
h / j / k / l |
Move table cursor, or move graph crosshair when graph focus and crosshair are enabled |
i |
Edit current cell |
a |
Add row |
A |
Add column |
d |
Delete selected row |
r |
Rename selected column |
g |
Focus graph panel |
t |
Focus table panel |
s |
Save CSV |
o |
Open/load CSV |
f |
Toggle best-fit line |
X |
Swap plotted x-axis and y-axis mapping |
G |
Toggle graph paper mode |
S |
Open manual scale dialog |
u |
Return to auto scale from the scale dialog |
c |
Toggle crosshair cursor |
? |
Help screen |
Esc |
Cancel current mode / return to normal mode |
q |
Quit |
- Run
cargo run -- samples/ohms_law.csv. - Use
j/kto move through rows andh/lto move between columns. - Press
i, type a value, then pressEnter. - Press
ato add another measurement row. - Press
Gfor graph-paper mode. - Press
Sto set manual graph-paper scale, such as fixed min/max, major divisions, and minor divisions per major square. - Press
fto toggle the best-fit line. - Press
g, thenc, then move the crosshair withh/j/k/lto read estimated graph coordinates. - Press
sto save.
The first row contains column names. The default columns are x and y; extra columns are preserved.
x,y
1,2.1
2,4.0
3,6.2
4,8.1Invalid or blank values in x or y are kept in the table but excluded from plotting and regression. Invalid x-y cells are highlighted in the table.
Graph paper mode prioritizes a clean grid for physics lab work:
- subtle minor grid divisions
- stronger major grid divisions every 10 minor divisions by default
- stronger x/y axes
- numeric labels at major divisions
- selected point marker
- optional best-fit line extended across the visible graph
- manual scale fields for x min, x max, y min, y max, x major division, y major division, and minor divisions
Unicode Braille characters are used when the terminal reports UTF-8 support, giving each terminal cell a 2x4 virtual pixel grid. Otherwise the plot falls back to a cleaner major-grid-only ASCII view.
nix-shell --run "cargo test"The test suite covers CSV loading/saving, linear regression, invalid value handling, and row editing operations.