Function graplot::x

source ·
pub fn x(end_x: f64) -> XEnd
Expand description

sets the absolute max value for x

Examples found in repository?
examples/tanh.rs (line 4)
3
4
5
6
fn main() {
    let plot = Plot::new((|x: f64| x.tanh(), x(6.)));
    plot.show()
}
More examples
Hide additional examples
examples/sigmoid.rs (line 4)
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();
}
examples/x3.rs (line 5)
3
4
5
6
7
fn main() {
    // x(...) ... sets the absolute max value for x
    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();
}