[][src]Struct plotters_unstable::prelude::Linspace

pub struct Linspace<T: Ranged, S: Clone, R: LinspaceRoundingMethod<T::ValueType>> where
    T::ValueType: Add<S, Output = T::ValueType> + PartialOrd + Clone
{ /* fields omitted */ }

The coordinate combinator that transform a continous coordinate to a discrete coordinate to a discrete coordinate by a giving step.

For example, range 0f32..100f32 is a continuous coordinate, thus this prevent us having a histogram on it since Plotters doesn't know how to segment the range into buckets. In this case, to get a histogram, we need to split the original range to a set of discrete buckets (for example, 0.5 per bucket).

The linspace decorate abstracting this method. For example, we can have a discrete coordinate: (0f32..100f32).step(0.5).

Linspace also supports different types of bucket matching method - This configuration alters the behavior of DiscreteCoord::index_of for Linspace coord spec

Implementations

impl<T: Ranged, S: Clone, R: LinspaceRoundingMethod<T::ValueType>> Linspace<T, S, R> where
    T::ValueType: Add<S, Output = T::ValueType> + PartialOrd + Clone
[src]

pub fn use_ceil(self) -> Linspace<T, S, Ceil<T::ValueType>>[src]

Set the linspace use the round up method for value matching

  • returns: The newly created linspace that uses new matching method

pub fn use_floor(self) -> Linspace<T, S, Floor<T::ValueType>>[src]

Set the linspace use the round down method for value matching

  • returns: The newly created linspace that uses new matching method

pub fn use_round(self) -> Linspace<T, S, Round<T::ValueType, S>> where
    T::ValueType: Sub<T::ValueType, Output = S>,
    S: PartialOrd
[src]

Set the linspace use the best match method for value matching

  • returns: The newly created linspace that uses new matching method

pub fn use_exact(self) -> Linspace<T, S, Exact<T::ValueType>> where
    T::ValueType: Sub<T::ValueType, Output = S>,
    S: PartialOrd
[src]

Set the linspace use the exact match method for value matching

  • returns: The newly created linspace that uses new matching method

Trait Implementations

impl<T: Clone + Ranged, S: Clone, R: Clone + LinspaceRoundingMethod<T::ValueType>> Clone for Linspace<T, S, R> where
    T::ValueType: Add<S, Output = T::ValueType> + PartialOrd + Clone,
    T::ValueType: Clone
[src]

impl<T: Ranged, S: Clone, R: LinspaceRoundingMethod<T::ValueType>> DiscreteRanged for Linspace<T, S, R> where
    T::ValueType: Add<S, Output = T::ValueType> + PartialOrd + Clone
[src]

impl<T: Ranged, S: Clone, R: LinspaceRoundingMethod<T::ValueType>> Ranged for Linspace<T, S, R> where
    T::ValueType: Add<S, Output = T::ValueType> + PartialOrd + Clone
[src]

type FormatOption = NoDefaultFormatting

This marker decides if Plotters default ValueFormatter implementation should be used. This assicated type can be one of follow two types: - DefaultFormatting will allow Plotters automatically impl the formatter based on Debug trait, if Debug trait is not impl for the Self::Value, ValueFormatter will not impl unless you impl it manually. Read more

type ValueType = T::ValueType

The type of this value in this range specification

impl<T, R, S, RM> ValueFormatter<T> for Linspace<R, S, RM> where
    R: Ranged<ValueType = T> + ValueFormatter<T>,
    RM: LinspaceRoundingMethod<T>,
    T: Add<S, Output = T> + PartialOrd + Clone,
    S: Clone
[src]

Auto Trait Implementations

impl<T, S, R> RefUnwindSafe for Linspace<T, S, R> where
    R: RefUnwindSafe,
    S: RefUnwindSafe,
    T: RefUnwindSafe,
    <T as Ranged>::ValueType: RefUnwindSafe

impl<T, S, R> Send for Linspace<T, S, R> where
    R: Send,
    S: Send,
    T: Send,
    <T as Ranged>::ValueType: Send

impl<T, S, R> Sync for Linspace<T, S, R> where
    R: Sync,
    S: Sync,
    T: Sync,
    <T as Ranged>::ValueType: Sync

impl<T, S, R> Unpin for Linspace<T, S, R> where
    R: Unpin,
    S: Unpin,
    T: Unpin,
    <T as Ranged>::ValueType: Unpin

impl<T, S, R> UnwindSafe for Linspace<T, S, R> where
    R: UnwindSafe,
    S: UnwindSafe,
    T: UnwindSafe,
    <T as Ranged>::ValueType: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsRangedCoord for T where
    T: Ranged
[src]

type CoordDescType = T

type Value = <T as Ranged>::ValueType

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<DC> ReversibleRanged for DC where
    DC: DiscreteRanged
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<R> ValueFormatter<<R as Ranged>::ValueType> for R where
    R: Ranged<FormatOption = DefaultFormatting>,
    <R as Ranged>::ValueType: Debug
[src]