Struct sampling::heatmap::HeatmapF64Mean[][src]

pub struct HeatmapF64Mean<HistX, HistY> { /* fields omitted */ }
Expand description

Heatmap with mean of y-axis

  • stores heatmap in row-major order: the rows of the heatmap are contiguous, and the columns are strided
  • enables you to quickly create a heatmap
  • you can create gnuplot scripts to plot the heatmap
  • for each x-axis bin, the y-axis mean is calculated

Difference to HeatmapF64

  • HeatmapF64 does not contain the averages for th y-axis, but can be transposed and also used for Y-Histograms which take types which do not implement AsPrimitive

Implementations

Internal HeatmapF64

Create a heatmap

  • creates new instance
  • hist_x defines the bins along the x-axis
  • hist_y defines the bins along the y-axis

Update Heatmap

This time, however, any value that is out of bounds will be ignored for the calculation of the mean of the y-axis, meaning also values which correspond to a valid x-bin will be ignored, if their y-value is not inside the Y Histogram. The mean respects the weight

Update heatmap

The difference is, that the mean of the y-axis is updated as long as y_val is finite and x_val is in bounds (because the mean is calculated for each bin in the x direction separately). The calculated average respects the weight

Internal slice for mean

  • The mean is calculated from this slice
  • The mean corresponds to the bins of the x-axis

Iterate over the calculated mean

  • iterates over the means
  • The mean corresponds to the bins of the x-axis
  • if a bin on the x-axis has no entries, the corresponding mean will be f64::NAN

Get a mean vector

  • The entries are the means corresponds to the bins of the x-axis
  • if a bin on the x-axis has no entries, the corresponding mean will be f64::NAN

Note

  • If you want to iterate over the mean values, use mean_iter instead

Create a gnuplot script to plot your heatmap

  • writer: The gnuplot script will be written to this
  • gnuplot_output_name: how shall the file, created by executing gnuplot, be called? Ending of file will be set automatically

Note

Create a gnuplot script to plot your heatmap

This function writes a file, that can be plotted in the terminal via gnuplot

gnuplot gnuplot_file

Parameter:

  • writer: writer gnuplot script will be written to
  • gnuplot_output_name: how shall the file, created by executing gnuplot, be called? File suffix (ending) will be set automatically
  • settings: Here you can set the axis, choose between terminals and more. I recommend that you take a look at GnuplotSettings
  • point_color: the mean (in y-direction) will be plotted as points in the heatmap. Here you can choose the point color

Notes

The default axis are the bin indices, which, e.g, means they always begin at 0. You have to set the axis via the GnuplotSettings

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast from Self to T

Try converting from Self to T

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling to an integer Read more

Try converting to integer with truncation Read more

Try converting to the nearest integer Read more

Try converting the floor to an integer Read more

Try convert the ceiling to an integer Read more

Convert from T to Self

Try converting from T to Self

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.