File: barchart_svg.rs

package info (click to toggle)
rust-plotlib 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 628 kB
  • sloc: sh: 19; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use plotlib::page::Page;
use plotlib::repr::BarChart;
use plotlib::style::BoxStyle;
use plotlib::view::CategoricalView;

fn main() {
    let b1 = BarChart::new(5.3).label("1");
    let b2 = BarChart::new(2.6)
        .label("2")
        .style(&BoxStyle::new().fill("darkolivegreen"));

    let v = CategoricalView::new().add(b1).add(b2).x_label("Experiment");

    Page::single(&v).save("barchart.svg").expect("saving svg");
}