[−][src]Trait preexplorer::traits::Configurable
Allows basic saving and plotting configuration.
Remarks
It is meant to be a black box for all configuration throught the
Configuration
struct, which is pursposely kept hidden.
Implementation
See traits module level documentation.
Required methods
fn configuration_mut(&mut self) -> &mut Configuration
Mutable access to Configuration
.
fn configuration(&self) -> &Configuration
Reference access to Configuration
.
Provided methods
fn set_title<S: Display>(&mut self, title: S) -> &mut Self
Set title, which in comparisons correspond to legends.
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_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.
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.
fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
Set a label in the x axis.
fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
Set a label in the y axis.
fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
fn set_rangex<S, T>(&mut self, left: S, right: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
f64: From<S>,
f64: From<T>,
Set the range in the x axis. If left > right, then the x axis is inverted.
fn set_rangey<S, T>(&mut self, down: S, up: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
f64: From<S>,
f64: From<T>,
Set the range in the y axis. If down > up, then the y axis is inverted.
fn set_xrange<S, T>(&mut self, left: S, right: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
f64: From<S>,
f64: From<T>,
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.
fn set_yrange<S, T>(&mut self, down: S, up: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
f64: From<S>,
f64: From<T>,
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.
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"));
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"));
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);
fn set_style<S>(&mut self, style: S) -> &mut Self where
Style: From<S>,
Style: From<S>,
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 is read as lines
.
let seq = (0..10).preexplore(); assert_eq!(seq.style().to_string().as_str(), "lines");
fn set_dashtype(&mut self, dashtype: usize) -> &mut Self
Choose the dashtype for the plot. Following the gnuplot standar, it has a cyclic behaviour.
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());
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();
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");
fn set_ticsx<T, S>(&mut self, ticsx: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
T: Into<Option<S>>,
S: Display,
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(), "");
fn set_ticsy<T, S>(&mut self, ticsy: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
T: Into<Option<S>>,
S: Display,
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(), "");
fn set_xtics<T, S>(&mut self, ticsx: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
T: Into<Option<S>>,
S: Display,
Control tics in the x axis. See gnuplot documentation for a correct format.
Remarks
This is a mirror method of ticsx
, for convinience.
fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
T: Into<Option<S>>,
S: Display,
Control tics in the y axis. See gnuplot documentation for a correct format.
Remarks
This is a mirror method of ticsy
, for convinience.
fn set_pause<T, S>(&mut self, pause: T) -> &mut Self where
T: Into<Option<S>>,
f64: From<S>,
T: Into<Option<S>>,
f64: From<S>,
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();
fn title(&self) -> Option<&String>
fn logx(&self) -> Option<f64>
fn logy(&self) -> Option<f64>
fn xlog(&self) -> Option<f64>
fn ylog(&self) -> Option<f64>
fn labelx(&self) -> Option<&String>
fn labely(&self) -> Option<&String>
fn xlabel(&self) -> Option<&String>
fn ylabel(&self) -> Option<&String>
fn rangex(&self) -> Option<(f64, f64)>
fn rangey(&self) -> Option<(f64, f64)>
fn xrange(&self) -> Option<(f64, f64)>
fn yrange(&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 xtics(&self) -> Option<&String>
fn ticsy(&self) -> Option<&String>
fn ytics(&self) -> Option<&String>
fn pause(&self) -> Option<f64>
Implementors
impl Configurable for Configuration
[src]
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
fn set_plot_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
[src]
fn set_title<S: Display>(&mut self, title: S) -> &mut Self
[src]
fn set_logx<N: Into<f64>>(&mut self, logx: N) -> &mut Self
[src]
fn set_logy<N: Into<f64>>(&mut self, logy: N) -> &mut Self
[src]
fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
[src]
fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
[src]
fn set_rangex<S, T>(&mut self, left: S, right: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
[src]
f64: From<S>,
f64: From<T>,
fn set_rangey<S, T>(&mut self, down: S, up: T) -> &mut Self where
f64: From<S>,
f64: From<T>,
[src]
f64: From<S>,
f64: From<T>,
fn set_style<S>(&mut self, style: S) -> &mut Self where
Style: From<S>,
[src]
Style: From<S>,
fn set_dashtype(&mut self, dashtype: usize) -> &mut Self
[src]
fn set_ticsx<T, S>(&mut self, ticsx: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
[src]
T: Into<Option<S>>,
S: Display,
fn set_ticsy<T, S>(&mut self, ticsy: T) -> &mut Self where
T: Into<Option<S>>,
S: Display,
[src]
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>,
[src]
T: Into<Option<S>>,
f64: From<S>,
fn plot_extension(&self) -> Option<&OsStr>
[src]
fn plot_path(&self) -> &Path
[src]
fn title(&self) -> Option<&String>
[src]
fn logx(&self) -> Option<f64>
[src]
fn logy(&self) -> Option<f64>
[src]
fn labelx(&self) -> Option<&String>
[src]
fn labely(&self) -> Option<&String>
[src]
fn rangex(&self) -> Option<(f64, f64)>
[src]
fn rangey(&self) -> Option<(f64, f64)>
[src]
fn style(&self) -> &Style
[src]
fn dashtype(&self) -> Option<usize>
[src]
fn ticsx(&self) -> Option<&String>
[src]
fn ticsy(&self) -> Option<&String>
[src]
fn pause(&self) -> Option<f64>
[src]
fn set_data_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> &mut Self
[src]
fn set_header(&mut self, header: bool) -> &mut Self
[src]
fn set_date(&mut self, date: DateTime<Local>) -> &mut Self
[src]
fn set_id<S: Display>(&mut self, id: S) -> &mut Self
[src]
fn data_extension(&self) -> Option<&OsStr>
[src]
fn data_path(&self) -> &Path
[src]
fn header(&self) -> bool
[src]
fn date(&self) -> &DateTime<Local>
[src]
fn id(&self) -> Option<&String>
[src]
fn checked_id(&self) -> &String
[src]
fn set_custom<S: Display, T: Display>(&mut self, key: S, value: T) -> &mut Self
[src]
fn custom<S: Display>(&self, key: S) -> Option<&String>
[src]
impl Configurable for SequenceError
[src]
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl Configurable for SequenceErrors
[src]
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for Data<T> where
T: Display,
[src]
T: Display,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for Densities<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for Density<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for ProcessError<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for ProcessErrors<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for Sequence<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for SequenceBin<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for SequenceBins<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for SequenceViolin<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for SequenceViolins<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T> Configurable for Sequences<T> where
T: Display + Clone,
[src]
T: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for Process<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for ProcessBin<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for ProcessBins<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for ProcessViolin<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for ProcessViolins<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S> Configurable for Processes<T, S> where
T: Display + Clone,
S: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S, U> Configurable for Heatmap<T, S, U> where
T: Display + Clone,
S: Display + Clone,
U: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
U: Display + Clone,
fn configuration_mut(&mut self) -> &mut Configuration
[src]
fn configuration(&self) -> &Configuration
[src]
impl<T, S, U> Configurable for Heatmaps<T, S, U> where
T: Display + Clone,
S: Display + Clone,
U: Display + Clone,
[src]
T: Display + Clone,
S: Display + Clone,
U: Display + Clone,