-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Following a request in labelled
(cf. larmarange/labelled#186), and now that ggplot2
uses variable labels by default for axis titles, it would be convenient to be able to apply a labeller function on axis titles, such as label_parsed()
or label_wrap_gen()
.
Following the approach used by ggtext
presented in the FAQ (https://ggplot2.tidyverse.org/articles/faq-axes.html?q=parse#how-can-i-add-superscripts-and-subscripts-to-axis-labels), a general possibility could be to consider adding a labeller
argument to element_text()
, so it would be possible to do things such as:
p +
theme(
axis.title.x = element_text(labeller = label_wrap_gen),
axis.title.y = element_text(labeller = label_parsed)
)
Would such a feature be worth considering?