Struct preexplorer::Heatmap [−][src]
pub struct Heatmap<T, S, U> where
T: Display + Clone,
S: Display + Clone,
U: Display + Clone, { /* fields omitted */ }
Expand description
Indexed sequence of values.
Check out pm3d documentation of gnuplot for more options.
Remarks
If you want to plot the original grid points (and not some interpolation), then try the command
splot <file> with points pointsize 3 pointtype 5 palette
adjusting the pointsize value (in this case 3
) to your case.
This is particularly useful when you have just a few values.
Examples
Quick plot.
use itertools::iproduct; use preexplorer::prelude::*; let values = iproduct!(0..10, 0..5).map(|(x, y)| x + y); pre::Heatmap::new(0..10, 0..5, values).plot("my_identifier").unwrap();
Compare Heatmap structs.
use itertools::iproduct; use preexplorer::prelude::*; pre::Heatmaps::new(vec![ pre::Heatmap::new(0..10, 0..5, iproduct!(0..10, 0..5).map(|(x, y)| x + y)), pre::Heatmap::new(0..10, 0..5, iproduct!(0..10, 0..5).map(|(x, y)| x * y)), ]) .plot("my_identifier").unwrap();
Implementations
pub fn new<I, J, K>(xs: I, ys: J, values: K) -> Heatmap<T, S, U> where
I: IntoIterator<Item = T>,
J: IntoIterator<Item = S>,
K: IntoIterator<Item = U>,
pub fn new<I, J, K>(xs: I, ys: J, values: K) -> Heatmap<T, S, U> where
I: IntoIterator<Item = T>,
J: IntoIterator<Item = S>,
K: IntoIterator<Item = U>,
Constructs a new Heatmap<T, S, U>
.
Panics
The number of values must be equal to the dimension of the grid
given by the cartesian product of xs
and ys
.
Examples
From a complicated computation.
use preexplorer::prelude::*; let values = iproduct!(0..10, 0..5).map(|(x, y)| x + y); let heatmap = pre::Heatmap::new(0..10, 0..5, values);
Trait Implementations
Performs the +=
operation. 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
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
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
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
.
Auto Trait Implementations
impl<T, S, U> RefUnwindSafe for Heatmap<T, S, U> where
S: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, S, U> UnwindSafe for Heatmap<T, S, U> where
S: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
pub fn approx_from(
src: Src
) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
pub fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Mutably borrows from an owned value. Read more
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
Attempt to convert the subject to a given type.
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
pub fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
pub fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.