Ascii Graph
Draw beautiful graphs in ascii art!
Showcase
- Basic use case.
let d = new // (width, height)
.set_1d_data
.draw;
println!;
273 |
|▄▄▄▄▄
|█████
246 |█████
|█████
|█████
219 |█████
|█████
|█████
192 |█████ █████
|█████ █████ ▄▄▄▄▄
|█████ █████ █████▄▄▄▄█████████
165 |█████ █████▄▄▄▄██████████████████
|█████ ███████████████████████████
|█████ ███████████████████████████
138 |█████ ███████████████████████████
|████████████████████████████████████
|████████████████████████████████████
└------------------------------------
0 1 3 5 7
- Handle outliers
let d = new
.set_block_width // calc the plot width based on the length of data
.set_1d_data
.draw;
println!;
1009 |
| ██
| ████
1006 | ██████
| ████████
| ████████
1003 | ████████
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | ████████ ▄▄██
| ████████ ▄▄██████
| ██████████████████
7 | ██████████████████
| ▄▄██████████████████
| ▄▄██████████████████████
1 |██████████████████████████
|██████████████████████████
|██████████████████████████
-5 |██████████████████████████
|██████████████████████████
|██████████████████████████
└--------------------------
0 4 8 12
- Highly customizable
let d = new
.set_title
.set_y_axis_label
.set_x_axis_label
.set_paddings
.set_1d_data
.draw;
println!;
Test Graph
y_axis
5242 |
| █
| ███
4957 | █████
| ███████
| █████████
4672 | ███████████
| █████████████
| ███████████████
4387 | ▄▄███████████████
| ▄▄█████████████████
| ▄▄███████████████████
4102 | █████████████████████
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
923 | ▄▄█████████████████████████
| ▄▄█████████████████████████████
| █████████████████████████████████
398 | ▄▄███████████████████████████████████
| ▄▄███████████████████████████████████████
|██████████████████████████████████████████
└------------------------------------------
0 390 780 1170 1560
x_axis