24 releases

0.8.6 Jan 28, 2024
0.8.4 Sep 12, 2023
0.8.0 Aug 28, 2021
0.6.0 Apr 4, 2021
0.3.0 Jun 28, 2018

#14 in Visualization

Download history 1425/week @ 2023-12-23 2532/week @ 2023-12-30 3841/week @ 2024-01-06 4142/week @ 2024-01-13 3959/week @ 2024-01-20 4051/week @ 2024-01-27 3597/week @ 2024-02-03 4657/week @ 2024-02-10 4688/week @ 2024-02-17 4899/week @ 2024-02-24 5946/week @ 2024-03-02 5364/week @ 2024-03-09 5297/week @ 2024-03-16 4598/week @ 2024-03-23 5071/week @ 2024-03-30 3844/week @ 2024-04-06

19,554 downloads per month
Used in 21 crates

MIT license

205KB
587 lines

textplots Crates.io

Terminal plotting library for using in Rust CLI applications. Should work well in any unicode terminal with monospaced font.

It is inspired by TextPlots.jl which is inspired by Drawille.

Currently it features only drawing line charts on Braille canvas, but could be extended to support other canvas and chart types just like UnicodePlots.jl or another cool terminal plotting library.

Contributions are very much welcome!

Usage

Using as a library

use textplots::{Chart, Plot, Shape};

fn main() {
    println!("y = sin(x) / x");

    Chart::default()
        .lineplot(&Shape::Continuous(Box::new(|x| x.sin() / x)))
        .display();
}

Using as a binary

textplots '10*x + x^2 + 10*sin(x)*abs(x)' --xmin=-20 --xmax=20

Bonus! Colored plots (see examples)

Building

Library

cargo build

Binary

cargo build --bin --release textplots --features="tool"

Dependencies

~0.2–9.5MB
~65K SLoC