imagesc
imagesc(matrix, [colormap="viridis"])
Input: matrix, colormap · Output: no output
What it is
matrix is a 2-D Mat of arbitrary real-valued numbers (no 0–255 requirement). colormap is an optional named string (default "viridis") selecting the palette, same set as heatmap's. False-color raster display of the plain numeric matrix (no pixel buffer produced) — pushes a dense Heatmap onto the current plot panel, reusing the same renderer as heatmap, just without per-cell value labels or gridlines. Defaults to viridis rather than heatmap's blues.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
imagesc(matrix, [colormap="viridis"]) | matrix matrix, Mat, or numbermatrix is a 2-D Mat of arbitrary real-valued numbers (no 0–255 requirement).colormap string, optional (default "viridis")colormap is an optional named string (default "viridis") selecting the palette, same set as heatmap's. | no output | Defaults to viridis rather than heatmap's blues. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
canvas = image_new(40, 30, r=200, g=200, b=200)
m = [10, 40, 250; 90, 140, 190; 220, 255, 30]
gray = image_from_matrix(m)
save_image("/tmp/gray.bmp", gray)
imagesc(m, colormap="viridis") # false-color view of the same matrix
big = resize(canvas, 80, 60, method="bilinear")
piece = crop(big, 10, 10, 30, 20)
print(piece.width, piece.height)
imshow(piece)
from images
How it works
imagesc(matrix, [colormap=]) (§ Image library, 2026-08-24) — false-color raster display of a plain numeric matrix: pure in-memory rendering, needing zero file-format decoding. Reuses the *exact* Heatmap grid renderer heatmap uses above, just in dense: true mode (no per-cell value label or gridline — the same mode spectrogram already established for "too many cells to label individually," which a raster image always is). Defaults to viridis (a perceptually-uniform read), not heatmap's own blues default.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.