Skip to content

Commit d229844

Browse files
committed
Slightly more interesting functions
1 parent bdc34a2 commit d229844

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/function_svg.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
extern crate plotlib;
22

33
fn main() {
4-
let f = plotlib::function::Function::new(|x| x, 0., 10.)
4+
let f1 = plotlib::function::Function::new(|x| x * 5., 0., 10.)
55
.style(plotlib::function::Style::new().colour("burlywood"));
6-
let v = plotlib::view::View::new().add(&f);
6+
let f2 = plotlib::function::Function::new(|x| x.powi(2), 0., 10.)
7+
.style(plotlib::function::Style::new().colour("darkolivegreen"));
8+
let f3 = plotlib::function::Function::new(|x| x.sqrt() * 20., 0., 10.)
9+
.style(plotlib::function::Style::new().colour("brown"));
10+
let v = plotlib::view::View::new().add(&f1).add(&f2).add(&f3);
711
plotlib::page::Page::single(&v).save("function.svg");
812
}

0 commit comments

Comments
 (0)