Struct preexplorer::SequenceBin[][src]

pub struct SequenceBin<T> where
    T: Display + Clone
{ /* fields omitted */ }
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

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

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Mutable access to Configuration.

Reference access to Configuration.

Set title, which in comparisons correspond to legends.

Set logaritmic scale in the x axis. Read more

Set logaritmic scale in the y axis. Read more

Set logaritmic scale in the x axis. Read more

Set logaritmic scale in the y axis. Read more

Set a label in the x axis.

Set a label in the y axis.

Set a label in the x axis. Read more

Set a label in the y axis. Read more

Set the range in the x axis. If left > right, then the x axis is inverted.

Set the range in the y axis. If down > up, then the y axis is inverted.

Set the range in the x axis. If left > right, then the x axis is inverted. Read more

Set the range in the y axis. If down > up, then the y axis is inverted. Read more

Set an extension for the data file. Read more

Set an extension for the data file. Read more

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

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 more

Choose the dashtype for the plot. Following the gnuplot standar, it has a cyclic behaviour. Read more

Choose the date used when saving files. Read more

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

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 more

Control tics in the x axis. Passing "" shows no tics. See gnuplot documentation for a correct format. Read more

Control tics in the y axis. Passing "" shows no tics. See gnuplot documentation for a correct format. Read more

Control tics in the x axis. See gnuplot documentation for a correct format. Read more

Control tics in the y axis. See gnuplot documentation for a correct format. Read more

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 more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Construct a suitable plot script for the struct.

Do everything except running the command of plotting. In other words: Read more

Main command. In other words: Read more

Plot with a custom script. In other words: Read more

Write plot script given by plot_script in the machine for posterior running. Read more

Helper method for implementing Plotable.

Helper method for implementing Plotable.

Extract the data from the struct. Read more

Save the data in a file. The directory is target\\preexplorer\\data\\. Read more

Save the file with a given id. It does not change the current id to save the data. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The error type produced by a failed conversion.

Convert the given value into an approximately equivalent representation.

The error type produced by a failed conversion.

Convert the subject into an approximately equivalent representation.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Approximate the subject with the default scheme.

Approximate the subject with a specific scheme.

Approximate the subject to a given type with the default scheme.

Approximate the subject to a given type with a specific scheme.

Convert the subject to a given type.

Attempt to convert the subject to a given type.

Attempt a value conversion of the subject to a given type.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The error type produced by a failed conversion.

Convert the given value into the subject type.

The type returned in the event of a conversion error.

Performs the conversion.

The error type produced by a failed conversion.

Convert the subject into the destination type.

The type returned in the event of a conversion error.

Performs the conversion.

The error type produced by a failed conversion.

Convert the given value into an exactly equivalent representation.

The error type produced by a failed conversion.

Convert the subject into an exactly equivalent representation.