format-title

Title-case a string break: capitalise the first letter of each space-separated word.

Usage

format-title()

Returns

A closure value => string.

Examples

Title-case discrete x-axis levels without renaming the underlying data.

#let d = ((g: "alpha", y: 4), (g: "beta", y: 7), (g: "gamma", y: 3))
#plot(
  data: d,
  mapping: aes(x: "g", y: "y"),
  layers: (geom-col(),),
  scales: (scale-x-discrete(labels: format-title()),),
  width: 10cm,
  height: 6cm,
)

Bar chart of three groups with discrete x-axis tick labels title-cased to Alpha, Beta, Gamma while the underlying levels stay alpha, beta, gamma.

Bar chart of three groups with discrete x-axis tick labels title-cased to Alpha, Beta, Gamma while the underlying levels stay alpha, beta, gamma.

See also

format-upper, format-lower, format-wrap.

Back to top