scale-linetype-discrete

Discrete linetype scale: alias of scale-linetype.

Identical to calling scale-linetype() directly; provided as an explicit-name alias.

Usage

scale-linetype-discrete(
  name: none,
  palette: auto,
  limits: none,
  labels: auto,
)

Parameters

Parameter Default Description
name none Legend title.
palette auto Array of dash keywords, or auto.
limits none Array of level names, or none.
labels auto Array of legend labels, or auto.

Returns

Scale object consumed by plot.

Examples

Discrete dash patterns picked up via the discrete alias.

#let d = (
  (x: 1, y: 2, grp: "a"), (x: 2, y: 4, grp: "a"),
  (x: 1, y: 1, grp: "b"), (x: 2, y: 2, grp: "b"),
)
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", linetype: "grp"),
  layers: (geom-line(stroke: 1pt),),
  scales: (scale-linetype-discrete(),),
  width: 10cm,
  height: 6cm,
)

Line chart of two groups along x against y where group a renders solid and group b renders dashed via the discrete alias of scale-linetype.

Line chart of two groups along x against y where group a renders solid and group b renders dashed via the discrete alias of scale-linetype.

See also

scale-linetype, geom-line.

Back to top