Struct preexplorer::Data
source · pub struct Data<T>where
T: Display,{ /* private fields */ }
Expand description
Generic multi-dimensional data.
§Remarks
It should be used with the plot_later command, writting the perfect plot script by interacting with gnuplot directly.
§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();
Implementations§
source§impl<T> Data<T>where
T: Display,
impl<T> Data<T>where
T: Display,
sourcepub fn new<I>(data: I, dim: usize) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn new<I>(data: I, dim: usize) -> Selfwhere
I: IntoIterator<Item = T>,
Constructs a new Data<T>
.
The parameter dim
represents the dimension of the data.
Consecutive values are read as part of the same data point,
meaning that a set of data {x = (x_1, x_2, …, x_d)}
should be given in an IntoIterator that gives the values in
the following order: x_1, x_2, …, x_d, y_1, y_2, …, y_d, etc.
Trait Implementations§
source§impl<T> Configurable for Data<T>where
T: Display,
impl<T> Configurable for Data<T>where
T: Display,
source§fn configuration_mut(&mut self) -> &mut Configuration
fn configuration_mut(&mut self) -> &mut Configuration
Mutable access to
Configuration
.source§fn configuration(&self) -> &Configuration
fn configuration(&self) -> &Configuration
Reference access to
Configuration
.source§fn set_title<S: Display>(&mut self, title: S) -> &mut Self
fn set_title<S: Display>(&mut self, title: S) -> &mut Self
Set title, which in comparisons correspond to legends.
source§fn set_logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self
fn set_logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self
Set logaritmic scale in the x axis. Read more
source§fn set_logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self
fn set_logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self
Set logaritmic scale in the y axis. Read more
source§fn set_logz<N: Into<f64>>(&mut self, logz: N) -> &mut Self
fn set_logz<N: Into<f64>>(&mut self, logz: N) -> &mut Self
Set logaritmic scale in the z axis. Read more
source§fn set_xlog<N: Into<f64>>(&mut self, logx: N) -> &mut Self
fn set_xlog<N: Into<f64>>(&mut self, logx: N) -> &mut Self
Set logaritmic scale in the x axis. Read more
source§fn set_ylog<N: Into<f64>>(&mut self, logy: N) -> &mut Self
fn set_ylog<N: Into<f64>>(&mut self, logy: N) -> &mut Self
Set logaritmic scale in the y axis. Read more
source§fn set_zlog<N: Into<f64>>(&mut self, logz: N) -> &mut Self
fn set_zlog<N: Into<f64>>(&mut self, logz: N) -> &mut Self
Set logaritmic scale in the z axis. Read more
source§fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
Set a label in the x axis.
source§fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
Set a label in the y axis.
source§fn set_labelz<S: Display>(&mut self, labelz: S) -> &mut Self
fn set_labelz<S: Display>(&mut self, labelz: S) -> &mut Self
Set a label in the z axis.
source§fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
Set a label in the x axis. Read more
source§fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
Set a label in the y axis. Read more
source§fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
Set a label in the z axis. Read more
source§fn set_rangex<S, T>(&mut self, left: S, right: T) -> &mut Self
fn set_rangex<S, T>(&mut self, left: S, right: T) -> &mut Self
Set the range in the x axis. If left > right, then the x axis is inverted.
source§fn set_rangey<S, T>(&mut self, down: S, up: T) -> &mut Self
fn set_rangey<S, T>(&mut self, down: S, up: T) -> &mut Self
Set the range in the y axis. If down > up, then the y axis is inverted.
source§fn set_rangez<S, T>(&mut self, down: S, up: T) -> &mut Self
fn set_rangez<S, T>(&mut self, down: S, up: T) -> &mut Self
Set the range in the z axis. If down > up, then the z axis is inverted.
source§fn set_xrange<S, T>(&mut self, left: S, right: T) -> &mut Self
fn set_xrange<S, T>(&mut self, left: S, right: T) -> &mut Self
Set the range in the x axis. If left > right, then the x axis is inverted. Read more
source§fn set_yrange<S, T>(&mut self, down: S, up: T) -> &mut Self
fn set_yrange<S, T>(&mut self, down: S, up: T) -> &mut Self
Set the range in the y axis. If down > up, then the y axis is inverted. Read more
source§fn set_zrange<S, T>(&mut self, down: S, up: T) -> &mut Self
fn set_zrange<S, T>(&mut self, down: S, up: T) -> &mut Self
Set the range in the z axis. If down > up, then the y axis is inverted. Read more
source§fn set_data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
fn set_data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
Set an extension for the data file. Read more
source§fn set_plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
fn set_plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
Set an extension for the data file. Read more
source§fn set_header(&mut self, header: bool) -> &mut Self
fn set_header(&mut self, header: bool) -> &mut Self
Decide the presence of headers in the data file.
If activated, then title, date and other information are
included as a comment in the data file. Read more
source§fn set_style<S>(
&mut self,
style: S
) -> Result<&mut Self, <S as TryInto<Style>>::Error>
fn set_style<S>( &mut self, style: S ) -> Result<&mut Self, <S as TryInto<Style>>::Error>
Choose the style for the plot. Too see all options, go to
Style
struct.
If you set a style and then compare with other structs, then
in the joint plot, the style shall be mantained for those structs that had
a style not setted by default. Read moresource§fn set_dashtype(&mut self, dashtype: usize) -> &mut Self
fn set_dashtype(&mut self, dashtype: usize) -> &mut Self
Choose the dashtype for the plot.
Following the gnuplot standar, it has a cyclic behaviour.
source§fn set_date(&mut self, date: DateTime<Local>) -> &mut Self
fn set_date(&mut self, date: DateTime<Local>) -> &mut Self
Choose the date used when saving files. Read more
source§fn set_id<S: Display>(&mut self, id: S) -> &mut Self
fn set_id<S: Display>(&mut self, id: S) -> &mut Self
Set the unique id or file name with which both data and plot script will be saved.
There is no default value and one must set it before plotting or saving. Read more
source§fn set_custom<S: Display, T: Display>(&mut self, key: S, value: T) -> &mut Self
fn set_custom<S: Display, T: Display>(&mut self, key: S, value: T) -> &mut Self
Include custom configuration fields into the
Configuration
struct.
This is intended for all new configurations you want, specially if
you are implementing the traits. Read moresource§fn set_ticsx<T, S>(&mut self, ticsx: T) -> &mut Self
fn set_ticsx<T, S>(&mut self, ticsx: T) -> &mut Self
Control tics in the x axis. Passing
""
shows no tics.
See gnuplot documentation for a correct format. Read moresource§fn set_ticsy<T, S>(&mut self, ticsy: T) -> &mut Self
fn set_ticsy<T, S>(&mut self, ticsy: T) -> &mut Self
Control tics in the y axis. Passing
""
shows no tics.
See gnuplot documentation for a correct format. Read moresource§fn set_ticsz<T, S>(&mut self, ticsz: T) -> &mut Self
fn set_ticsz<T, S>(&mut self, ticsz: T) -> &mut Self
Control tics in the z axis. Passing
""
shows no tics.
See gnuplot documentation for a correct format.source§fn set_xtics<T, S>(&mut self, ticsx: T) -> &mut Self
fn set_xtics<T, S>(&mut self, ticsx: T) -> &mut Self
Control tics in the x axis. See gnuplot documentation for a correct format. Read more
source§fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self
fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self
Control tics in the y axis. See gnuplot documentation for a correct format. Read more
source§fn set_ztics<T, S>(&mut self, ticsz: T) -> &mut Self
fn set_ztics<T, S>(&mut self, ticsz: T) -> &mut Self
Control tics in the z axis. See gnuplot documentation for a correct format. Read more
source§fn set_pause<T, S>(&mut self, pause: T) -> &mut Self
fn set_pause<T, S>(&mut self, pause: T) -> &mut Self
Control the time for which the plot is in the screen. The unit is seconds.
Any negative number means “until a key is pressed”. To have no pause, pass
0
, instead of None
. Read morefn title(&self) -> Option<&String>
fn logx(&self) -> Option<f64>
fn logy(&self) -> Option<f64>
fn logz(&self) -> Option<f64>
fn xlog(&self) -> Option<f64>
fn ylog(&self) -> Option<f64>
fn zlog(&self) -> Option<f64>
fn labelx(&self) -> Option<&String>
fn labely(&self) -> Option<&String>
fn labelz(&self) -> Option<&String>
fn xlabel(&self) -> Option<&String>
fn ylabel(&self) -> Option<&String>
fn zlabel(&self) -> Option<&String>
fn rangex(&self) -> Option<(f64, f64)>
fn rangey(&self) -> Option<(f64, f64)>
fn rangez(&self) -> Option<(f64, f64)>
fn xrange(&self) -> Option<(f64, f64)>
fn yrange(&self) -> Option<(f64, f64)>
fn zrange(&self) -> Option<(f64, f64)>
fn plot_extension(&self) -> Option<&OsStr>
fn data_extension(&self) -> Option<&OsStr>
fn plot_path(&self) -> &Path
fn data_path(&self) -> &Path
fn header(&self) -> bool
fn style(&self) -> &Style
fn dashtype(&self) -> Option<usize>
fn date(&self) -> &DateTime<Local>
fn id(&self) -> Option<&String>
fn checked_id(&self) -> &String
fn custom<S: Display>(&self, key: S) -> Option<&String>
fn ticsx(&self) -> Option<&String>
fn ticsy(&self) -> Option<&String>
fn ticsz(&self) -> Option<&String>
fn xtics(&self) -> Option<&String>
fn ytics(&self) -> Option<&String>
fn ztics(&self) -> Option<&String>
fn pause(&self) -> Option<f64>
source§impl<T> PartialEq for Data<T>
impl<T> PartialEq for Data<T>
source§impl<T> Plotable for Data<T>
impl<T> Plotable for Data<T>
source§fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, PreexplorerError>
fn plot<S: Display>(&mut self, id: S) -> Result<&mut Self, PreexplorerError>
Calls plot_later method and retunrs error since generic data should be plotted by hand interacting with gnuplot.
source§fn plot_script(&self) -> String
fn plot_script(&self) -> String
Construct a suitable plot script for the struct.
source§fn plot_later<S: Display>(
&mut self,
id: S
) -> Result<&mut Self, PreexplorerError>
fn plot_later<S: Display>( &mut self, id: S ) -> Result<&mut Self, PreexplorerError>
Do everything except running the command of plotting.
In other words: Read more
source§fn plot_with_script<S: Display, T: Display>(
&mut self,
id: S,
script: T
) -> Result<&mut Self, PreexplorerError>
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: Read more
source§fn write_plot_script<S: Display>(
&self,
gnuplot_script: S
) -> Result<&Self, PreexplorerError>
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. Read moresource§fn opening_plot_script(&self) -> String
fn opening_plot_script(&self) -> String
Helper method for implementing
Plotable
.source§fn ending_plot_script(&self) -> String
fn ending_plot_script(&self) -> String
Helper method for implementing
Plotable
.source§impl<T> Saveable for Data<T>
impl<T> Saveable for Data<T>
source§fn plotable_data(&self) -> String
fn plotable_data(&self) -> String
Extract the data from the struct. Read more
source§fn save(&self) -> Result<&Self, PreexplorerError>
fn save(&self) -> Result<&Self, PreexplorerError>
Save the data in a file. The directory is
target\\preexplorer\\data\\
. Read moresource§fn save_with_id<S: Display>(&self, id: S) -> Result<&Self, PreexplorerError>
fn save_with_id<S: Display>(&self, id: S) -> Result<&Self, PreexplorerError>
Save the file with a given
id
.
It does not change the current id to save the data. Read moreimpl<T> StructuralPartialEq for Data<T>where
T: Display,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Data<T>where
T: RefUnwindSafe,
impl<T> Send for Data<T>where
T: Send,
impl<T> Sync for Data<T>where
T: Sync,
impl<T> Unpin for Data<T>where
T: Unpin,
impl<T> UnwindSafe for Data<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.