[][src]Trait preexplorer::traits::Plotable

pub trait Plotable: Configurable + Saveable {
    fn plot_script(&self) -> String;

    fn plot_later<S: Display>(
        &mut self,
        id: S
    ) -> Result<&mut Self, SavingError> { ... }
fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, SavingError> { ... }
fn plot_with_script<S: Display, T: Display>(
        &mut self,
        id: S,
        script: T
    ) -> Result<&mut Self, SavingError> { ... }
fn write_plot_script<S: Display>(
        &self,
        gnuplot_script: S
    ) -> Result<&Self, SavingError> { ... }
fn opening_plot_script(&self) -> String { ... }
fn ending_plot_script(&self) -> String { ... } }

Allows quick plotting.

Implementation

See traits module level documentation.

Required methods

fn plot_script(&self) -> String

Construct a suitable plot script for the struct.

Loading content...

Provided methods

fn plot_later<S: Display>(&mut self, id: S) -> Result<&mut Self, SavingError>

Do everything except running the command of plotting. In other words:

  1. Assign id.
  2. Save the data.
  3. Save the plot script.

Remarks

Specially useful when used in Data struct. So one can write the particular plot script later.

Examples

Save data and plot script for posterior analysis.

let data = array![
    [1, 2, 3, 4, 5],
    [2, 5, 6, 7, 8],
    [3, 11, 12, 13, 14],
];
let dim = 5;

pre::Data::new(data.iter(), dim)
    .plot_later("my_identifier")
    .unwrap();

fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, SavingError>

Main command. In other words:

  1. Assign id.
  2. Save the data.
  3. Save the plot script.
  4. Run (asynchronous) the plot script.

Examples

Quickest plot.

(0..10).preexplore()
    .plot("my_identifier")
    .unwrap();

fn plot_with_script<S: Display, T: Display>(
    &mut self,
    id: S,
    script: T
) -> Result<&mut Self, SavingError>

Plot with a custom script. In other words:

  1. Assign id.
  2. Save the data.
  3. Save the custom plot script.
  4. Run (asynchronous) the plot script.

Remarks

This is useful when you found a particular gnuplot script you want to plot your data with and want to do it directly from Rust. Then, you must hard-code your script in Rust (copy-paste from internet, most of the times).

Note that you will have to write the full path to the data in the gnuplot format, see the example for more.

Examples

Quickest plot.

let mut seq = (0..10).preexplore();
seq.plot_with_script("my_identifier", "
plot \"target/preexplorer/data/my_identifier.txt\" with linespoints linecolor 3
pause 3
").unwrap();

fn write_plot_script<S: Display>(
    &self,
    gnuplot_script: S
) -> Result<&Self, SavingError>

Write plot script given by plot_script in the machine for posterior running.

Remarks

The method plot_later might be more useful.

fn opening_plot_script(&self) -> String

Helper method for implementing Plotable.

fn ending_plot_script(&self) -> String

Helper method for implementing Plotable.

Loading content...

Implementors

impl<T> Plotable for Data<T> where
    T: Display + Clone
[src]

fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, SavingError>[src]

Call plot_later and retunrs error, since generic data should be plotted by hand interacting with gnuplot.

fn plot_script(&self) -> String[src]

Basic plot script with the instructions to search for the perfect plot in internet.

impl<T> Plotable for Densities<T> where
    T: PartialOrd + Display + Clone
[src]

impl<T> Plotable for Density<T> where
    T: PartialOrd + Display + Clone
[src]

fn plot_script(&self) -> String[src]

Construct a suitable plot script for the struct.

Remarks

Only works for real numbers.

impl<T> Plotable for Sequences<T> where
    T: Display + Clone
[src]

impl<T> Plotable for Sequence<T> where
    T: Display + Clone
[src]

impl<T, S> Plotable for Processes<T, S> where
    T: Display + Clone,
    S: Display + Clone
[src]

impl<T, S> Plotable for Process<T, S> where
    T: Display + Clone,
    S: Display + Clone
[src]

Loading content...