Crate textplots[−][src]
Terminal plotting library for using in 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 plots on Braille canvas, but could be extended to support other canvas and chart types just like UnicodePlots.jl or any other cool terminal plotting library.
Contributions are very much welcome!
Usage
[dependencies]
textplots = "0.2"
extern crate textplots; use textplots::{Chart, Plot}; fn main() { println!("y = sin(x) / x"); Chart::default().lineplot(|x| x.sin() / x ).display(); }
It will display something like this:
Default viewport size is 120 x 60 points, with X values ranging from -10 to 10.
You can override the defaults calling new
.
use textplots::{Chart, Plot}; println!("y = cos(x), y = sin(x) / 2"); Chart::new(180, 60, -5.0, 5.0) .lineplot( |x| x.cos() ) .lineplot( |x| x.sin() / 2.0 ) .display();
Modules
utils |
Helpers for passing the data into plots. |
Structs
Chart |
Controls the drawing. |
Traits
Plot |
Provides an interface for drawing plots. |