label_bquote()
offers a flexible way of labelling
facet rows or columns with plotmath expressions. Backquoted
variables will be replaced with their value in the facet.
label_bquote(rows = NULL, cols = NULL, default)
rows | Backquoted labelling expression for rows. |
---|---|
cols | Backquoted labelling expression for columns. |
default | Unused, kept for compatibility. |
# The variables mentioned in the plotmath expression must be # backquoted and referred to by their names. p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() p + facet_grid(vs ~ ., labeller = label_bquote(alpha ^ .(vs)))