Struct BoxPlot

Source
pub struct BoxPlot<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> BoxPlot<'a>

Source

pub fn from_slice(v: &'a [f64]) -> Self

Examples found in repository?
examples/boxplot_svg.rs (line 7)
6fn main() {
7    let b1 = BoxPlot::from_slice(&[1.0, 4.0, 2.0, 3.5, 6.4, 2.5, 7.5, 1.8, 9.6]).label("1");
8    let b2 = BoxPlot::from_slice(&[3.0, 4.3, 2.0, 3.5, 6.9, 4.5, 7.5, 1.8, 10.6])
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new()
13        .add(b1)
14        .add(b2)
15        .x_label("Experiment")
16        .y_label("y");
17
18    Page::single(&v)
19        .dimensions(400, 300)
20        .save("boxplot.svg")
21        .expect("saving svg");
22}
Source

pub fn from_vec(v: Vec<f64>) -> Self

Source

pub fn style(self, style: &BoxStyle) -> Self

Examples found in repository?
examples/boxplot_svg.rs (line 10)
6fn main() {
7    let b1 = BoxPlot::from_slice(&[1.0, 4.0, 2.0, 3.5, 6.4, 2.5, 7.5, 1.8, 9.6]).label("1");
8    let b2 = BoxPlot::from_slice(&[3.0, 4.3, 2.0, 3.5, 6.9, 4.5, 7.5, 1.8, 10.6])
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new()
13        .add(b1)
14        .add(b2)
15        .x_label("Experiment")
16        .y_label("y");
17
18    Page::single(&v)
19        .dimensions(400, 300)
20        .save("boxplot.svg")
21        .expect("saving svg");
22}
Source

pub fn get_style(&self) -> &BoxStyle

Source

pub fn label<T>(self, label: T) -> Self
where T: Into<String>,

Examples found in repository?
examples/boxplot_svg.rs (line 7)
6fn main() {
7    let b1 = BoxPlot::from_slice(&[1.0, 4.0, 2.0, 3.5, 6.4, 2.5, 7.5, 1.8, 9.6]).label("1");
8    let b2 = BoxPlot::from_slice(&[3.0, 4.3, 2.0, 3.5, 6.9, 4.5, 7.5, 1.8, 10.6])
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new()
13        .add(b1)
14        .add(b2)
15        .x_label("Experiment")
16        .y_label("y");
17
18    Page::single(&v)
19        .dimensions(400, 300)
20        .save("boxplot.svg")
21        .expect("saving svg");
22}
Source

pub fn get_label(&self) -> &String

Trait Implementations§

Source§

impl<'a> CategoricalRepresentation for BoxPlot<'a>

Source§

fn range(&self) -> (f64, f64)

The maximum range. Used for auto-scaling axis

Source§

fn ticks(&self) -> Vec<String>

The ticks that this representation covers. Used to collect all ticks for display

Source§

fn to_svg( &self, x_axis: &CategoricalAxis, y_axis: &ContinuousAxis, face_width: f64, face_height: f64, ) -> Group

Source§

fn to_text( &self, _x_axis: &CategoricalAxis, _y_axis: &ContinuousAxis, _face_width: u32, _face_height: u32, ) -> String

Auto Trait Implementations§

§

impl<'a> Freeze for BoxPlot<'a>

§

impl<'a> RefUnwindSafe for BoxPlot<'a>

§

impl<'a> Send for BoxPlot<'a>

§

impl<'a> Sync for BoxPlot<'a>

§

impl<'a> Unpin for BoxPlot<'a>

§

impl<'a> UnwindSafe for BoxPlot<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.