SecreC 2 language 2.9.0 (2026.10)
Language and standard library reference
Loading...
Searching...
No Matches
Functions

Functions

template<domain D :shared3p >
D int32 heatmap (D int32 x, D int32 y, D bool xIsAvailable, D bool yIsAvailable, uint K)
 
template<domain D :shared3p >
D int64 heatmap (D int64 x, D int64 y, D bool xIsAvailable, D bool yIsAvailable, uint K)
 
template<domain D :shared3p >
D float32 heatmap (D float32 x, D float32 y, D bool xIsAvailable, D bool yIsAvailable, uint K)
 
template<domain D :shared3p >
D float64 heatmap (D float64 x, D float64 y, D bool xIsAvailable, D bool yIsAvailable, uint K)
 

Detailed Description

Create a heatmap.

Note
D - shared3p
Supported types - int32 / int64 / float32 / float64
Parameters
x- first sample
y- second sample
xIsAvailable- vector indicating which elements of x are available
yIsAvailable- vector indicating which elements of y are available
K- minimal length of bin side
Note
A heatmap (in this case) is a plot of two variables of a set of data. It can be used to visualise data in the same way as a scatterplot while leaking less information about individual values. Values of sample x will determine coordinates on the x axis and values of sample y will determine coordinates on the y axis. Instead of displaying individual points, this function counts the number of points in fixed rectangular areas (called bins). The counts will then be replaced with ranges.
Returns
returns a matrix with two rows. The second row is a flattened matrix with as many elements as there are bins in the heatmap. The second row may actually be longer if there's less than 8 elements in the matrix. Each bin will contain a number, starting from 1, which indicates the frequency range of the bin. When plotting, a bin with matrix coordinates (i, j) and value z will have its lower left point at (xmin + i · xstep, ymin + j · ystep), will have dimensions (xstep, ystep) and will indicate a frequency count in the range [zmin + z · zstep, zmin + (z + 1) · zstep). The first 8 elements of the first row are
xminbeginning of x-axis
yminbeginning of y-axis
xstepdifference of x-axis tics
ystepdifference of y-axis tics
zminbeginning of z-axis
zstepdifference of z-axis tics
rowsnumber of rows in the matrix
columnsnumber of columns in the matrix
Leakage
Leaks the minimum and maximum values in both inputs

Function Documentation

◆ heatmap() [1/4]

template<domain D :shared3p >
D float32 heatmap ( D float32  x,
D float32  y,
D bool  xIsAvailable,
D bool  yIsAvailable,
uint  K 
)

◆ heatmap() [2/4]

template<domain D :shared3p >
D float64 heatmap ( D float64  x,
D float64  y,
D bool  xIsAvailable,
D bool  yIsAvailable,
uint  K 
)

◆ heatmap() [3/4]

template<domain D :shared3p >
D int32 heatmap ( D int32  x,
D int32  y,
D bool  xIsAvailable,
D bool  yIsAvailable,
uint  K 
)

◆ heatmap() [4/4]

template<domain D :shared3p >
D int64 heatmap ( D int64  x,
D int64  y,
D bool  xIsAvailable,
D bool  yIsAvailable,
uint  K 
)