plotlet v0.6.2

imshow

Gridded & matrix

Minimal call

import math
grid = [[math.sin(r * 0.15) + math.cos(col * 0.1) for col in range(80)]
        for r in range(60)]

c = pt.chart(xlabel="col", ylabel="row")
c.add_imshow(grid, cmap="magma")

Worked example

import math

import plotlet as pt

data = [[math.sin(r * 0.07) + math.cos(c * 0.05) for c in range(160)]
        for r in range(120)]

c = pt.chart(title="imshow", xlabel="col", ylabel="row",
             data_width=320, data_height=240)
c.add_imshow(data, cmap="magma")

Docstring

2-D array → colored grid. Branches between many <rect>s and one PNG.

The threshold (`imshow_max_rects` in spec.json) trades vector cleanliness
for SVG file size. Below the threshold, each cell is its own <rect> — sharp
at any zoom. Above, the whole image is encoded as base64 PNG.

`origin` controls vertical orientation. Default `"lower"` puts row 0 at
the BOTTOM of the data rectangle (Cartesian). Opt in to `"upper"` for
matrix-style display (row 0 at top, what you see when you print the
array); the panel auto-inverts the y-axis in that case so tick "0"
lands next to row 0.

Color mapping goes through `ContinuousNorm`, which supports `norm="log"`
and `center=` on top of the default linear range.