pub struct FuncPlotBuilder<'a> { /* private fields */ }Expand description
Builder for a Function Plot Set various options for plotting the function.
§Options
func- Input function.domain- Specified domain to plot the function over. Default is computed.range- Specified range to display the function over. Default is computed.domain_padding- Proportion of the width of the domain to be padded with. Default is 0.1.range_padding- Proportion of the height of the range to be padded with. Default is 0.1.size- Dimensions (in characters) of the outputted plot. Default is (60, 10).title- Optional title for the plot. Default is None.axes- Whether or not to display axes and axes labels. Default is true.
§Notes
Use .precompute() to generate and save values to minimize future function calls when plotting.
Implementations§
Source§impl<'a> FuncPlotBuilder<'a>
impl<'a> FuncPlotBuilder<'a>
pub fn set_domain(&mut self, domain: (f64, f64)) -> &mut Self
pub fn set_range(&mut self, range: (f64, f64)) -> &mut Self
pub fn set_domain_padding(&mut self, padding: f64) -> &mut Self
pub fn set_range_padding(&mut self, padding: f64) -> &mut Self
pub fn set_size(&mut self, size: (u32, u32)) -> &mut Self
pub fn set_title<'b: 'a>(&mut self, title: &'b str) -> &mut Self
pub fn set_axes(&mut self, do_axes: bool) -> &mut Self
pub fn enable_precomputation(&mut self) -> &mut Self
Sourcepub fn precompute(&mut self, resolution: u32)
pub fn precompute(&mut self, resolution: u32)
Generate values before other computations so that f is called as few times as possible.
resolution parameter sets the number of datapoints precompute is allowed to generate.
The higher the resolution, the more detail will be in the output graph.
Sourcepub fn as_image(&self) -> RenderableTextBuilder<'_>
pub fn as_image(&self) -> RenderableTextBuilder<'_>
Returns a rendered text builder to render a string
Sourcepub fn save_pyplot(&self, path: &str)
pub fn save_pyplot(&self, path: &str)
Saves the plot’s data using pyplot
Trait Implementations§
Source§impl<'a> Clone for FuncPlotBuilder<'a>
impl<'a> Clone for FuncPlotBuilder<'a>
Source§fn clone(&self) -> FuncPlotBuilder<'a>
fn clone(&self) -> FuncPlotBuilder<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for FuncPlotBuilder<'a>
impl<'a> !RefUnwindSafe for FuncPlotBuilder<'a>
impl<'a> !Send for FuncPlotBuilder<'a>
impl<'a> !Sync for FuncPlotBuilder<'a>
impl<'a> Unpin for FuncPlotBuilder<'a>
impl<'a> !UnwindSafe for FuncPlotBuilder<'a>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more