Examples for 'ggplot2::label_bquote'


Label with mathematical expressions

Aliases: label_bquote

Keywords:

### ** Examples

# 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)))
plot of chunk example-ggplot2-label_bquote-1
p + facet_grid(. ~ vs, labeller = label_bquote(cols = .(vs) ^ .(vs)))
plot of chunk example-ggplot2-label_bquote-1
p + facet_grid(. ~ vs + am, labeller = label_bquote(cols = .(am) ^ .(vs)))
plot of chunk example-ggplot2-label_bquote-1

[Package ggplot2 version 3.3.6 Index]