File: line_and_point_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 (19 lines) | stat: -rw-r--r-- 509 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use plotlib::page::Page;
use plotlib::repr::Plot;
use plotlib::style::*;
use plotlib::view::ContinuousView;

fn main() {
    let l1 = Plot::new(vec![(0., 1.), (2., 1.5), (3., 1.2), (4., 1.1)])
        .line_style(
            LineStyle::new()
                .colour("burlywood")
                .linejoin(LineJoin::Round),
        )
        .point_style(PointStyle::new());

    let v = ContinuousView::new().add(l1);
    Page::single(&v)
        .save("line_and_point.svg")
        .expect("saving svg");
}