Struct preexplorer::SequenceBin
source · pub struct SequenceBin<T>{ /* private fields */ }
Expand description
Sequence of histograms normalize to represent a probability density function through bins.
To renormalize the histograms (that cover a unit area by default),
change the renormalization constant in the gnuplot script.
By trying out with gnuplot, you can find the perfect fit.
§Examples
Quick plot.
use preexplorer::prelude::*;
let data = (0..10).map(|i| (i..10 + i));
let binwidth = 0.5;
pre::SequenceBin::new(data, binwidth).plot("my_identifier").unwrap();
Compare SequenceBin structs.
use preexplorer::prelude::*;
pre::SequenceBins::new(vec![
pre::SequenceBin::new((0..10).map(|i| (i..10 + i)), 1),
pre::SequenceBin::new((0..10).map(|i| (i..10 + i)), 0.5),
])
.plot("my_identifier").unwrap();
Implementations§
source§impl<T> SequenceBin<T>
impl<T> SequenceBin<T>
sourcepub fn new<I, J, S>(data: I, binwidth: S) -> SequenceBin<T>
pub fn new<I, J, S>(data: I, binwidth: S) -> SequenceBin<T>
Constructs a new SequenceBin<T>
.
§Remarks
To change the binwidth, please refer to the gnuplot script generated. By construction, a fixed binwidth is needed. This is okay in most of the cases, since it gives consistency and allows plotting constant values. If you want to change it, please go to the gnuplot script.
Negative binwidths are handled by gnuplot. This crate simply prints the binwidth in the correct place in the gnuplot script generated, so if you use a value less or equal to zero gnuplot will resolve this issue by using a default behaviour.
§Examples
From a complicated computation.
use preexplorer::prelude::*;
let data = (0..10).map(|i| (i..10 + i));
let binwidth = 0.5;
let seq_bin = pre::SequenceBin::new(data, binwidth);
Trait Implementations§
source§impl<T> Add<SequenceBin<T>> for SequenceBins<T>
impl<T> Add<SequenceBin<T>> for SequenceBins<T>
§type Output = SequenceBins<T>
type Output = SequenceBins<T>
+
operator.source§fn add(self, other: SequenceBin<T>) -> Self
fn add(self, other: SequenceBin<T>) -> Self
+
operation. Read moresource§impl<T> Add for SequenceBin<T>
impl<T> Add for SequenceBin<T>
§type Output = SequenceBins<T>
type Output = SequenceBins<T>
+
operator.source§fn add(self, other: SequenceBin<T>) -> SequenceBins<T>
fn add(self, other: SequenceBin<T>) -> SequenceBins<T>
+
operation. Read moresource§impl<T> AddAssign<SequenceBin<T>> for SequenceBins<T>
impl<T> AddAssign<SequenceBin<T>> for SequenceBins<T>
source§fn add_assign(&mut self, other: SequenceBin<T>)
fn add_assign(&mut self, other: SequenceBin<T>)
+=
operation. Read moresource§impl<T> Clone for SequenceBin<T>
impl<T> Clone for SequenceBin<T>
source§fn clone(&self) -> SequenceBin<T>
fn clone(&self) -> SequenceBin<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T> Configurable for SequenceBin<T>
impl<T> Configurable for SequenceBin<T>
source§fn configuration_mut(&mut self) -> &mut Configuration
fn configuration_mut(&mut self) -> &mut Configuration
Configuration
.source§fn configuration(&self) -> &Configuration
fn configuration(&self) -> &Configuration
Configuration
.source§fn set_title<S: Display>(&mut self, title: S) -> &mut Self
fn set_title<S: Display>(&mut self, title: S) -> &mut Self
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
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
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
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
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
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
source§fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_labelx<S: Display>(&mut self, labelx: S) -> &mut Self
source§fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
fn set_labely<S: Display>(&mut self, labely: S) -> &mut Self
source§fn set_labelz<S: Display>(&mut self, labelz: S) -> &mut Self
fn set_labelz<S: Display>(&mut self, labelz: S) -> &mut Self
source§fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
fn set_xlabel<S: Display>(&mut self, labelx: S) -> &mut Self
source§fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
fn set_ylabel<S: Display>(&mut self, labely: S) -> &mut Self
source§fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
fn set_zlabel<S: Display>(&mut self, labelz: S) -> &mut Self
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
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
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
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
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
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
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
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
source§fn set_header(&mut self, header: bool) -> &mut Self
fn set_header(&mut self, header: bool) -> &mut Self
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>
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
source§fn set_date(&mut self, date: DateTime<Local>) -> &mut Self
fn set_date(&mut self, date: DateTime<Local>) -> &mut Self
source§fn set_id<S: Display>(&mut self, id: S) -> &mut Self
fn set_id<S: Display>(&mut self, id: S) -> &mut Self
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
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
""
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
""
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
""
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
source§fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self
fn set_ytics<T, S>(&mut self, ticsy: T) -> &mut Self
source§fn set_ztics<T, S>(&mut self, ticsz: T) -> &mut Self
fn set_ztics<T, S>(&mut self, ticsz: T) -> &mut Self
source§fn set_pause<T, S>(&mut self, pause: T) -> &mut Self
fn set_pause<T, S>(&mut self, pause: T) -> &mut Self
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> Debug for SequenceBin<T>
impl<T> Debug for SequenceBin<T>
source§impl<T> From<SequenceBin<T>> for SequenceBins<T>
impl<T> From<SequenceBin<T>> for SequenceBins<T>
source§fn from(sequence: SequenceBin<T>) -> Self
fn from(sequence: SequenceBin<T>) -> Self
source§impl<T> PartialEq for SequenceBin<T>
impl<T> PartialEq for SequenceBin<T>
source§fn eq(&self, other: &SequenceBin<T>) -> bool
fn eq(&self, other: &SequenceBin<T>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<T> Plotable for SequenceBin<T>
impl<T> Plotable for SequenceBin<T>
source§fn plot_script(&self) -> String
fn plot_script(&self) -> String
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>
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>
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>
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>
plot_script
in the machine for posterior running. Read moresource§fn opening_plot_script(&self) -> String
fn opening_plot_script(&self) -> String
Plotable
.source§fn ending_plot_script(&self) -> String
fn ending_plot_script(&self) -> String
Plotable
.source§impl<T> Saveable for SequenceBin<T>
impl<T> Saveable for SequenceBin<T>
source§fn plotable_data(&self) -> String
fn plotable_data(&self) -> String
source§fn save(&self) -> Result<&Self, PreexplorerError>
fn save(&self) -> Result<&Self, PreexplorerError>
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>
id
.
It does not change the current id to save the data. Read more