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

#11 in Visualization

Download history 5235/week @ 2024-08-18 4597/week @ 2024-08-25 4780/week @ 2024-09-01 4305/week @ 2024-09-08 3896/week @ 2024-09-15 4331/week @ 2024-09-22 4761/week @ 2024-09-29 4642/week @ 2024-10-06 4142/week @ 2024-10-13 4752/week @ 2024-10-20 5741/week @ 2024-10-27 5014/week @ 2024-11-03 4468/week @ 2024-11-10 4771/week @ 2024-11-17 4481/week @ 2024-11-24 4699/week @ 2024-12-01

18,598 downloads per month
Used in 27 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–11MB
~59K SLoC