Expand description
sets the absolute max value for x
3
4
5
6
fn main() {
let plot = Plot::new((|x: f64| x.tanh(), x(6.)));
plot.show()
}
More examples
Hide additional examples
3
4
5
6
fn main() {
let plot = Plot::new((|x: f64| 1. / (1. + (-x).exp()), x(6.)));
plot.show()
}
examples/polynomial.rs (
line 5)
3
4
5
6
7
fn main() {
let poly = Polynomial::new(&[2., 3., 1.], &[2., 3., 2.]);
let plot = Plot::new((poly, x(10.)));
plot.show();
}
3
4
5
6
7
fn main() {
let plot = Plot::new((|x: f64| x.powf(3.) + x.powf(2.) - 0.08, x(1.)));
plot.show();
}
examples/title_and_axis.rs (
line 4)
3
4
5
6
7
8
9
10
fn main() {
let mut plot = Plot::new((|x: f64| x.cos(), x(6.)));
plot.set_title("cosine wave");
plot.set_xlabel("x axis");
plot.set_ylabel("y axis");
plot.show();
}
examples/custom_scaling.rs (
line 4)
3
4
5
6
7
8
9
10
11
fn main() {
let mut plot = Plot::new((|x: f64| x.cos(), x(5.)));
plot.set_desc(Desc {
min_steps_x: 6.,
spacing_x: 47.,
..Default::default()
});
plot.show();
}
Additional examples can be found in: