We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdc34a2 commit d229844Copy full SHA for d229844
examples/function_svg.rs
@@ -1,8 +1,12 @@
1
extern crate plotlib;
2
3
fn main() {
4
- let f = plotlib::function::Function::new(|x| x, 0., 10.)
+ let f1 = plotlib::function::Function::new(|x| x * 5., 0., 10.)
5
.style(plotlib::function::Style::new().colour("burlywood"));
6
- let v = plotlib::view::View::new().add(&f);
+ 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);
11
plotlib::page::Page::single(&v).save("function.svg");
12
}
0 commit comments