Trait preexplorer::traits::Configurable
source · pub trait Configurable {
Show 73 methods
// Required methods
fn configuration_mut(&mut self) -> &mut Configuration;
fn configuration(&self) -> &Configuration;
// Provided methods
fn set_title<S: Display>(&mut self, title: S) -> &mut Self { ... }
fn set_logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self { ... }
fn set_logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self { ... }
fn set_logz<N: Into<f64>>(&mut self, logz: N) -> &mut Self { ... }
fn set_xlog<N: Into<f64>>(&mut self, logx: N) -> &mut Self { ... }
fn set_ylog<N: Into<f64>>(&mut self, logy: N) -> &mut Self { ... }
fn set_zlog<N: Into<f64>>(&mut self, logz: N) -> &mut Self { ... }
fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self { ... }
fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self { ... }
fn set_labelz<S: Display>(&mut self, labelz: S) -> &mut Self { ... }
fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self { ... }
fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self { ... }
fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self { ... }
fn set_rangex<S, T>(&mut self, left: S, right: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_rangey<S, T>(&mut self, down: S, up: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_rangez<S, T>(&mut self, down: S, up: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_xrange<S, T>(&mut self, left: S, right: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_yrange<S, T>(&mut self, down: S, up: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_zrange<S, T>(&mut self, down: S, up: T) -> &mut Self
where f64: From<S> + From<T> { ... }
fn set_data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self { ... }
fn set_plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self { ... }
fn set_header(&mut self, header: bool) -> &mut Self { ... }
fn set_style<S>(
&mut self,
style: S
) -> Result<&mut Self, <S as TryInto<Style>>::Error>
where S: TryInto<Style> { ... }
fn set_dashtype(&mut self, dashtype: usize) -> &mut Self { ... }
fn set_date(&mut self, date: DateTime<Local>) -> &mut Self { ... }
fn set_id<S: Display>(&mut self, id: S) -> &mut Self { ... }
fn set_custom<S: Display, T: Display>(
&mut self,
key: S,
value: T
) -> &mut Self { ... }
fn set_ticsx<T, S>(&mut self, ticsx: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_ticsy<T, S>(&mut self, ticsy: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_ticsz<T, S>(&mut self, ticsz: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_xtics<T, S>(&mut self, ticsx: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_ztics<T, S>(&mut self, ticsz: T) -> &mut Self
where T: Into<Option<S>>,
S: Display { ... }
fn set_pause<T, S>(&mut self, pause: T) -> &mut Self
where T: Into<Option<S>>,
f64: From<S> { ... }
fn 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> { ... }
}
Expand description
Required Methods§
sourcefn configuration_mut(&mut self) -> &mut Configuration
fn configuration_mut(&mut self) -> &mut Configuration
Mutable access to Configuration
.
sourcefn configuration(&self) -> &Configuration
fn configuration(&self) -> &Configuration
Reference access to Configuration
.
Provided Methods§
sourcefn 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.
sourcefn 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.
§Remark
The x axis that will be ploted should not include zero.
This is a mirror method of logx
, for convinience.
sourcefn 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.
§Remark
The y axis that will be ploted should not include zero.
This is a mirror method of logy
, for convinience.
sourcefn 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.
§Remark
The z axis that will be ploted should not include zero.
This is a mirror method of logz
, for convinience.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
sourcefn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
sourcefn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
§Remarks
This is a mirror method of rangex
, for convinience.
sourcefn 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.
§Remarks
This is a mirror method of rangey
, for convinience.
sourcefn 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.
§Remarks
This is a mirror method of rangez
, for convinience.
sourcefn 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.
§Default
The default value is txt
.
let seq = (0..10).preexplore();
assert_eq!(seq.data_extension().unwrap().to_str(), Some("txt"));
sourcefn 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.
§Default
The default value is gnu
.
let seq = (0..10).preexplore();
assert_eq!(seq.plot_extension().unwrap().to_str(), Some("gnu"));
sourcefn 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.
§Default
The default value is true
.
let seq = (0..10).preexplore();
assert_eq!(seq.header(), true);
sourcefn 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.
§Default
The default value is default
, which means lines
.
let seq = (0..10).preexplore();
assert_eq!(seq.style().to_string(), "Default".to_string());
sourcefn 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.
sourcefn 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.
§Default
Time upon creation.
let seq = (0..10).preexplore();
println!("{}", seq.date());
sourcefn 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.
When only saving data, prefer saving_with_id
method.
§Remarks
Commonly used methods like plot
and plot_later
internally call this method for ease of use.
§Examples
Correctly identifying before saving.
let mut seq = (0..10).preexplore();
seq.set_id("my_id").save().unwrap();
Incorrectly identifying before saving. This panics.
(0..10).preexplore().save().unwrap();
sourcefn 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.
§Examples
Setting a subtitle option.
let mut seq = (0..10).preexplore();
seq.set_custom("subtitle", "My subtitle");
assert_eq!(seq.custom("subtitle").unwrap().as_str(), "My subtitle");
sourcefn 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.
§Examples
Showing only from 0 to 10, at a step of 0.35.
let mut seq = (0..10).preexplore();
seq.set_ticsx("0, 1.35, 10");
assert_eq!(seq.ticsx().unwrap().as_str(), "0, 1.35, 10");
Showing no tics.
let mut seq = (0..10).preexplore();
seq.set_ticsx("");
assert_eq!(seq.ticsx().unwrap().as_str(), "");
sourcefn 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.
§Examples
Showing only from 0 to 10, at a step of 0.35.
let mut seq = (0..10).preexplore();
seq.set_ticsy("0, 1.35, 10");
assert_eq!(seq.ticsy().unwrap().as_str(), "0, 1.35, 10");
Showing no tics.
let mut seq = (0..10).preexplore();
seq.set_ticsy("");
assert_eq!(seq.ticsx().unwrap().as_str(), "");
sourcefn 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.
sourcefn 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.
§Remarks
This is a mirror method of ticsx
, for convinience.
sourcefn 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.
§Remarks
This is a mirror method of ticsy
, for convinience.
sourcefn 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.
§Remarks
This is a mirror method of ticsz
, for convinience.
sourcefn 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
.
§Default
The default value is -1.
let seq = (0..10).preexplore();
assert_eq!(seq.pause(), Some(-1.0));
§Examples
This plot will wait two seconds before closing.
let mut seq = (0..10).preexplore();
seq.set_pause(2);
assert_eq!(seq.pause(), Some(2.0));
seq.plot("two_seconds_test").unwrap();
This plot will have no pause before closing.
let mut seq = (0..10).preexplore();
seq.set_pause(0);
assert_eq!(seq.pause(), Some(0.0));
seq.plot("silent_plot").unwrap();