element-line
Line element: colour and thickness.
Pass the result to theme under keys like panel-grid or axis-line.
Usage
element-line(
colour: none,
thickness: none,
)Parameters
| Parameter | Default | Description |
|---|---|---|
colour |
none |
Line colour, or none to inherit. |
thickness |
none |
Line thickness (a Typst length), or none. |
Returns
Element dictionary consumed by theme.
Examples
Recolour the panel grid via theme.
#let d = range(0, 10).map(i => (x: i, y: i * 0.5))
#plot(
data: d,
mapping: aes(x: "x", y: "y"),
layers: (geom-point(size: 2pt),),
theme: theme(panel-grid: element-line(colour: rgb("#d9cfbf"))),
width: 10cm,
height: 6cm,
)Strengthen the axis line by setting both colour and thickness.
#let d = range(0, 10).map(i => (x: i, y: i * 0.5))
#plot(
data: d,
mapping: aes(x: "x", y: "y"),
layers: (geom-point(size: 2pt),),
theme: theme(axis-line: element-line(
colour: rgb("#cc0000"),
thickness: 1pt,
)),
width: 10cm,
height: 6cm,
)