draw-key-point

Draw-key returning a small filled circle.

Used by point and jitter geoms.

Usage

draw-key-point()

Returns

Draw-key dictionary consumed by the legend renderer.

Examples

Force the point glyph in the legend (the default for points).

#let d = (
  (x: 1, y: 1, g: "a"),
  (x: 2, y: 2, g: "b"),
)
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", fill: "g"),
  layers: (geom-point(size: 3pt, key: draw-key-point()),),
  width: 8cm,
  height: 5cm,
)

Scatter chart of two fill-coded points with the legend explicitly using filled-circle marker glyphs for each level.

Scatter chart of two fill-coded points with the legend explicitly using filled-circle marker glyphs for each level.

Use the point glyph on a layer that would otherwise default to a different shape, like a line layered over points.

#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-point()),),
  width: 8cm,
  height: 5cm,
)

Line chart with two colour-coded series whose legend glyphs are filled markers instead of the default short stroke.

Line chart with two colour-coded series whose legend glyphs are filled markers instead of the default short stroke.

See also

draw-key-line, draw-key-rect, draw-key-path, draw-key-blank.

Back to top