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

    // Provided methods
    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 { ... }
}
Expand description

Allows quick plotting.

§Implementation

See traits module level documentation.

Required Methods§

source

fn plot_script(&self) -> String

Construct a suitable plot script for the struct.

Provided Methods§

source

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();
source

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();
source

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();
source

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.

source

fn opening_plot_script(&self) -> String

Helper method for implementing Plotable.

source

fn ending_plot_script(&self) -> String

Helper method for implementing Plotable.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Plotable for SequenceError

source§

impl Plotable for SequenceErrors

source§

impl<T> Plotable for Data<T>
where T: Display + Clone,

source§

impl<T> Plotable for Densities<T>
where T: Display + Clone,

source§

impl<T> Plotable for Density<T>
where T: Display + Clone,

source§

impl<T> Plotable for ProcessError<T>
where T: Display + Clone,

source§

impl<T> Plotable for ProcessErrors<T>
where T: Display + Clone,

source§

impl<T> Plotable for Sequence<T>
where T: Display + Clone,

source§

impl<T> Plotable for SequenceBin<T>
where T: Display + Clone,

source§

impl<T> Plotable for SequenceBins<T>
where T: Display + Clone,

source§

impl<T> Plotable for SequenceViolin<T>
where T: Display + Clone,

source§

impl<T> Plotable for SequenceViolins<T>
where T: Display + Clone,

source§

impl<T> Plotable for Sequences<T>
where T: Display + Clone,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<T, S, U> Plotable for Contour<T, S, U>
where T: Display + Clone, S: Display + Clone, U: Display + Clone,

source§

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

source§

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