Struct poloto::Plotter [−][src]
Keeps track of plots. User supplies iterators that will be iterated on when render is called.
Implementations
impl<'a, D: Names> Plotter<'a, D>
[src]
pub fn line(
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
[src]
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
Create a line from plots.
Example
let data=[ [1.0f64,4.0], [2.0,5.0], [3.0,6.0] ]; use poloto::prelude::*; let mut plotter = poloto::plot("title","x","y"); plotter.line("data",data.iter().map(|&x|x).twice_iter());
pub fn line_fill(
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
[src]
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
Create a line from plots that will be filled underneath.
Example
let data=[ [1.0f64,4.0], [2.0,5.0], [3.0,6.0] ]; use poloto::prelude::*; let mut plotter = poloto::plot("title","x","y"); plotter.line_fill("data",data.iter().map(|&x|x).twice_iter());
pub fn scatter(
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
[src]
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
Create a scatter plot from plots.
Example
let data=[ [1.0f64,4.0], [2.0,5.0], [3.0,6.0] ]; use poloto::prelude::*; let mut plotter = poloto::plot("title","x","y"); plotter.scatter("data",data.iter().map(|&x|x).twice_iter());
pub fn histogram(
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
[src]
&mut self,
name: impl Display + 'a,
plots: impl DoubleIterator<Item = [f64; 2]> + 'a
) -> &mut Self
Create a histogram from plots. Each bar’s left side will line up with a point
Example
let data=[ [1.0f64,4.0], [2.0,5.0], [3.0,6.0] ]; use poloto::prelude::*; let mut s=String::new(); let mut plotter = poloto::plot("title","x","y"); plotter.histogram("data",data.iter().map(|&x|x).twice_iter());
pub fn render_to_string(self) -> Result<String, Error>
[src]
pub fn render_fmt(self, f: &mut Formatter<'_>) -> Result
[src]
pub fn render_io<T: Write>(self, writer: T) -> Result<T, Error>
[src]
pub fn render<T: Write>(self, writer: T) -> Result<T, Error>
[src]
Render the svg to the writer.
Up until now, nothing has been written to the writer. We have just accumulated a list of commands and closures. This call will actually call all the closures and consume all the plot iterators.
Auto Trait Implementations
impl<'a, D> !RefUnwindSafe for Plotter<'a, D>
impl<'a, D> !Send for Plotter<'a, D>
impl<'a, D> !Sync for Plotter<'a, D>
impl<'a, D> Unpin for Plotter<'a, D> where
D: Unpin,
D: Unpin,
impl<'a, D> !UnwindSafe for Plotter<'a, D>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,