Struct poloto::Plotter[][src]

pub struct Plotter<'a, D: Names> { /* fields omitted */ }

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]

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]

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]

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]

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

impl<'a, D> !UnwindSafe for Plotter<'a, D>

Blanket Implementations

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

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<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.