heatmap
Creates a heat map plot of a scalar field.
Syntax
-
heatmap(f, ❨xmin, xmax[, δx]❩, ❨ymin, ymax[, δy]❩[, c[, m]])-
fis a function D → ℝ where D ⊂ ℝ² -
xmin,xmax,ymin, andymaxare real numbers -
δxandδyare non-negative real numbers -
cis a colour, a list of two or three colours, or a function [0, 1] → colours -
mis a boolean
-
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❩)
heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, "red")
sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, '("blue", "red"))
sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, '("blue", "white", "red"))
sf ≔ heatmap((x, y) ↦ sin(√(x^2 + y^2)), ❨−10, 10❩, ❨−10, 10❩, x ↦ hsv(360⋅x, 1, 1))