draw-key-line
Draw-key returning a short horizontal line.
Used by line, path, step, smooth, segment, hline, vline, and abline geoms.
Usage
draw-key-line()Returns
Draw-key dictionary consumed by the legend renderer.
Examples
Short stroke glyph (the default for line layers).
#let d = (
(x: 1, y: 1, g: "a"),
(x: 2, y: 2, g: "a"),
(x: 1, y: 3, g: "b"),
(x: 2, y: 1, g: "b"),
)
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "g"),
layers: (geom-line(key: draw-key-line()),),
width: 8cm,
height: 5cm,
)Override a column layer’s default rectangle glyph with a line stroke.
#let d = (
(g: "a", n: 3),
(g: "b", n: 5),
)
#plot(
data: d,
mapping: aes(x: "g", y: "n", fill: "g"),
layers: (geom-col(key: draw-key-line()),),
width: 8cm,
height: 5cm,
)See also
draw-key-point, draw-key-rect, draw-key-path, draw-key-blank.