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

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

Set the linspace use the round up method for value matching

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

Set the linspace use the round down method for value matching

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

Set the linspace use the best match method for value matching

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

Set the linspace use the exact match method for value matching

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Get the number of element in the range Note: we assume that all the ranged discrete coordinate has finite value Read more

Map a value to the index Read more

Reverse map the index to the value Read more

Return a iterator that iterates over the all possible values Read more

Returns the previous value in this range Read more

Returns the next value in this range Read more

This marker decides if Plotters default ValueFormatter implementation should be used. This associated type can be one of the following two types: Read more

The type of this value in this range specification

Get the range of this value

This function maps the value to i32, which is the drawing coordinate

This function gives the key points that we can draw a grid based on this

This function provides the on-axis part of its range

Format the value

Determine how we can format a value in a coordinate system by default

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Type to describe a coordinate system

Type for values in the given coordinate system

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Perform the reverse mapping

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.