[][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, PreexplorerError> { ... }
fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, PreexplorerError> { ... }
fn plot_with_script<S: Display, T: Display>(
        &mut self,
        id: S,
        script: T
    ) -> Result<&mut Self, PreexplorerError> { ... }
fn write_plot_script<S: Display>(
        &self,
        gnuplot_script: S
    ) -> Result<&Self, PreexplorerError> { ... }
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, PreexplorerError>

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, PreexplorerError>

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, PreexplorerError>

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, PreexplorerError>

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 Plotable for SequenceError[src]

impl Plotable for SequenceErrors[src]

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

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

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

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

impl<T> Plotable for Density<T> where
    T: 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 ProcessError<T> where
    T: Display + Clone
[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading content...