Struct Boxplot

Source
pub struct Boxplot<K, O>
where O: BoxplotOrient<K, f32>,
{ /* private fields */ }
Expand description

The boxplot element

Implementations§

Source§

impl<K> Boxplot<K, BoxplotOrientV<K, f32>>
where K: Clone,

Source

pub fn new_vertical( key: K, quartiles: &Quartiles, ) -> Boxplot<K, BoxplotOrientV<K, f32>>

Create a new vertical boxplot element.

  • key: The key (the X axis value)
  • quartiles: The quartiles values for the Y axis
  • returns The newly created boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_vertical("group", &quartiles);
Source§

impl<K> Boxplot<K, BoxplotOrientH<K, f32>>
where K: Clone,

Source

pub fn new_horizontal( key: K, quartiles: &Quartiles, ) -> Boxplot<K, BoxplotOrientH<K, f32>>

Create a new horizontal boxplot element.

  • key: The key (the Y axis value)
  • quartiles: The quartiles values for the X axis
  • returns The newly created boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_horizontal("group", &quartiles);
Source§

impl<K, O> Boxplot<K, O>
where O: BoxplotOrient<K, f32>,

Source

pub fn style<S>(self, style: S) -> Boxplot<K, O>
where S: Into<ShapeStyle>,

Set the style of the boxplot.

  • S: The required style
  • returns The up-to-dated boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_horizontal("group", &quartiles).style(&BLUE);
Source

pub fn width(self, width: u32) -> Boxplot<K, O>

Set the bar width.

  • width: The required width
  • returns The up-to-dated boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_horizontal("group", &quartiles).width(10);
Source

pub fn whisker_width(self, whisker_width: f64) -> Boxplot<K, O>

Set the width of the whiskers as a fraction of the bar width.

  • whisker_width: The required fraction
  • returns The up-to-dated boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_horizontal("group", &quartiles).whisker_width(0.5);
Source

pub fn offset<T>(self, offset: T) -> Boxplot<K, O>
where T: Into<f64> + Copy,

Set the element offset on the key axis.

  • offset: The required offset (on the X axis for vertical, on the Y axis for horizontal)
  • returns The up-to-dated boxplot element
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let plot = Boxplot::new_horizontal("group", &quartiles).offset(-5);

Trait Implementations§

Source§

impl<K, DB, O> Drawable<DB> for Boxplot<K, O>
where DB: DrawingBackend, O: BoxplotOrient<K, f32>,

Source§

fn draw<I>( &self, points: I, backend: &mut DB, _: (u32, u32), ) -> Result<(), DrawingErrorKind<<DB as DrawingBackend>::ErrorType>>
where I: Iterator<Item = (i32, i32)>,

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly
Source§

impl<'a, K, O> PointCollection<'a, (<O as BoxplotOrient<K, f32>>::XType, <O as BoxplotOrient<K, f32>>::YType)> for &'a Boxplot<K, O>
where K: Clone, O: BoxplotOrient<K, f32>,

Source§

type Point = (<O as BoxplotOrient<K, f32>>::XType, <O as BoxplotOrient<K, f32>>::YType)

The item in point iterator
Source§

type IntoIter = Vec<<&'a Boxplot<K, O> as PointCollection<'a, (<O as BoxplotOrient<K, f32>>::XType, <O as BoxplotOrient<K, f32>>::YType)>>::Point>

The point iterator
Source§

fn point_iter( self, ) -> <&'a Boxplot<K, O> as PointCollection<'a, (<O as BoxplotOrient<K, f32>>::XType, <O as BoxplotOrient<K, f32>>::YType)>>::IntoIter

framework to do the coordinate mapping

Auto Trait Implementations§

§

impl<K, O> Freeze for Boxplot<K, O>
where K: Freeze,

§

impl<K, O> RefUnwindSafe for Boxplot<K, O>

§

impl<K, O> Send for Boxplot<K, O>
where K: Send, O: Send,

§

impl<K, O> Sync for Boxplot<K, O>
where K: Sync, O: Sync,

§

impl<K, O> Unpin for Boxplot<K, O>
where K: Unpin, O: Unpin,

§

impl<K, O> UnwindSafe for Boxplot<K, O>
where K: UnwindSafe, O: UnwindSafe,

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<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for T
where T: Drawable<DB> + 'b, &'a T: for<'a> PointCollection<'a, Coord>, Coord: Clone, DB: DrawingBackend,

Source§

fn into_dyn(self) -> DynElement<'b, DB, Coord>

Make the conversion
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.