colorbar
Creates a color bar using the color information of a colored plot instance
like scatter
or colormesh
.
This generates a new (usually slim) diagram with a filled gradient
according to the color map used in the plot, appropriate ticks, and
optionally a label. This diagram can be configured through general set
rules on diagram
and through additional arguments passed through
colorbar.args
.
#show: lq.set-diagram(height: 3.5cm, width: 4cm)
#let mesh = lq.colormesh(
lq.linspace(-0.3, 1.3),
lq.linspace(-0.3, 1.3),
(x, y) => x * y,
map: gradient.linear(..color.map.icefire).sharp(9)
)
#lq.diagram(
mesh
)
#lq.colorbar(mesh, thickness: 2mm)