Algosim documentation: heatmap

heatmap

Creates a heat map plot of a scalar field.

Syntax

Description

The heatmap function creates a heat map plot of the scalar field f in the rectangular region [xmin, xmax] × [ymin, ymax] with a sampling distance of δx in the first dimension and δy in the second dimension.

The plot is shown in the current diagram and a reference to the plot is returned.

The c and m parameters control the colour scheme. The same algorithm is used for the MatrixPlot function; see that article for details.

Examples

D ≔ diagram("vector field");
sf ≔ heatmap((x, y) ↦ x^2 + y^2, ❨−10, 10❩, ❨−10, 10❩, '("white", "red"));
vf ≔ VectorField((x, y) ↦ ❨2⋅x, 2⋅y❩, ❨−10, 10❩, ❨−10, 10❩)

Image 1

heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, "red")

Image 2

sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, '("blue", "red"))

Image 3

sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, '("blue", "white", "red"))

Image 4

sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, x ↦ hsv(360⋅x, 1, 1))

Image 5

See also