scale-linetype-identity

Linetype scale that uses each row’s value as the dash keyword directly.

The mapped column must contain dash keywords accepted by geom-line ("solid", "dashed", "dotted", "dash-dotted", "densely-dashed", "loosely-dashed").

Usage

scale-linetype-identity(
  name: none,
)

Parameters

Parameter Default Description
name none Legend title. Identity scales draw no legend.

Returns

Scale object consumed by plot.

Examples

Per-row dash keyword carried straight through to the line.

#let d = (
  (x: 1, y: 2, dt: "solid"),  (x: 2, y: 3, dt: "solid"),
  (x: 1, y: 1, dt: "dashed"), (x: 2, y: 2, dt: "dashed"),
)
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", linetype: "dt"),
  layers: (geom-line(stroke: 1pt),),
  scales: (scale-linetype-identity(),),
  width: 10cm,
  height: 6cm,
)

Line chart of two segments along x against y where the dt column passes through verbatim, drawing one solid line and one dashed line.

Line chart of two segments along x against y where the dt column passes through verbatim, drawing one solid line and one dashed line.

See also

scale-linetype, scale-linetype-manual, geom-line.

Back to top