ploot
Note: This is almost entirely machine generated code. It works for my applications but comes with absolutely no guarantees regarding API stability or anything else. Use at your own risk.
A terminal plotting library for Rust that renders charts using Unicode Braille characters (U+2800-U+28FF).
Each terminal cell encodes a 2x4 sub-pixel grid, giving smooth curves at high effective resolution without leaving the terminal.

Usage
Add ploot to your Cargo.toml:
[]
= "0.1.2"
Figure / Axes2D builder API
use ;
let mut fig = new;
fig.set_terminal_size;
fig.show;
Quick one-shot API
For simple plots without the full builder:
let xs: = .map.collect;
let ys: = xs.iter.map.collect;
let plot = quick_plot;
println!;
Plot multiple series with automatic color cycling:
let xs: = .map.collect;
let quadratic: = xs.iter.map.collect;
let cubic: = xs.iter.map.collect;
let sine: = xs.iter.map.collect;
let gaussian: = xs.iter.map.collect;
let plot = quick_plot_multi;
println!;
Features
- Braille rendering - 2x4 sub-pixel resolution per terminal cell via bitwise dot compositing
- Plot types - lines, scatter (points), lines+points, bar charts (boxes), fill-between areas, error bars (X/Y), error lines (X/Y), box-and-whisker
- Point symbols - six marker styles: dot, cross, circle, diamond, triangle, square
- ANSI color - automatic 7-color palette cycling (blue, red, green, yellow, cyan, magenta, white), with additive color mixing when curves overlap
- Axis layout - auto-generated tick marks using Heckbert's nice numbers algorithm, dynamic label width computation, configurable title and axis labels
- Secondary axes - independent x2/y2 axes with separate ranges, labels, and tick marks
- Logarithmic scaling - per-axis log-scale support with any base
- Grid lines - major and minor grid with configurable color and dash patterns
- Legend - automatic legend with 4-corner placement control, optional title, horizontal/vertical layout
- Line drawing - Bresenham's algorithm with dash pattern support (solid, dash, dot, dot-dash, etc.)
- Viewport clipping - Cohen-Sutherland algorithm clips lines to the canvas bounds
- Annotations - text labels and arrows positioned in data or graph coordinates
- Custom ticks - user-defined tick positions and labels
- Axis reversal - flip axis direction
- Multiplot - subplot grid layout with shared super-title
- LTTB downsampling - automatic downsampling for large datasets
- Terminal size detection - auto-detect terminal dimensions via ioctl/env fallback
- Zero dependencies - pure Rust, no external crates
Architecture
API (Figure, Axes2D, options, series data)
└─ Render (series dispatching, rendering order, grid/legend/annotation overlay)
└─ Layout (space allocation, tick generation, frame rendering)
└─ Transform (data → normalized → pixel coordinate mapping, clipping, downsampling)
└─ Canvas (BrailleCanvas, Bresenham lines, dash patterns, color compositing)
License
Apache-2.0