pub enum PlotPoints {
Owned(Vec<PlotPoint>),
Generator(ExplicitGenerator),
}
Expand description
Represents many PlotPoint
s.
These can be an owned Vec
or generated with a function.
Variants§
Implementations§
Source§impl PlotPoints
impl PlotPoints
pub fn new(points: Vec<[f64; 2]>) -> PlotPoints
pub fn points(&self) -> &[PlotPoint]
Sourcepub fn from_explicit_callback(
function: impl Fn(f64) -> f64 + 'static,
x_range: impl RangeBounds<f64>,
points: usize,
) -> PlotPoints
pub fn from_explicit_callback( function: impl Fn(f64) -> f64 + 'static, x_range: impl RangeBounds<f64>, points: usize, ) -> PlotPoints
Draw a line based on a function y=f(x)
, a range (which can be infinite) for x and the number of points.
Sourcepub fn from_parametric_callback(
function: impl Fn(f64) -> (f64, f64),
t_range: impl RangeBounds<f64>,
points: usize,
) -> PlotPoints
pub fn from_parametric_callback( function: impl Fn(f64) -> (f64, f64), t_range: impl RangeBounds<f64>, points: usize, ) -> PlotPoints
Draw a line based on a function (x,y)=f(t)
, a range for t and the number of points.
The range may be specified as start..end or as start..=end.
Sourcepub fn from_ys_f32(ys: &[f32]) -> PlotPoints
pub fn from_ys_f32(ys: &[f32]) -> PlotPoints
From a series of y-values. The x-values will be the indices of these values
Sourcepub fn from_ys_f64(ys: &[f64]) -> PlotPoints
pub fn from_ys_f64(ys: &[f64]) -> PlotPoints
From a series of y-values. The x-values will be the indices of these values
Trait Implementations§
Source§impl Default for PlotPoints
impl Default for PlotPoints
Source§fn default() -> PlotPoints
fn default() -> PlotPoints
Returns the “default value” for a type. Read more
Source§impl FromIterator<[f64; 2]> for PlotPoints
impl FromIterator<[f64; 2]> for PlotPoints
Source§fn from_iter<T>(iter: T) -> PlotPoints
fn from_iter<T>(iter: T) -> PlotPoints
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for PlotPoints
impl !RefUnwindSafe for PlotPoints
impl !Send for PlotPoints
impl !Sync for PlotPoints
impl Unpin for PlotPoints
impl !UnwindSafe for PlotPoints
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.