Description Usage Arguments Details Value Examples
ggplot2 labeller function for plotmath labels.
To be used in ggplot2 scale_*_ functions as the label
argument.
1 |
labels |
character vector of labels to be parsed |
It is useful when breaks are plotmath-ready character vectors. This function correctly formats them in order to be parsed and displayed as expressions.
a list of expressions
1 2 3 4 5 6 7 8 9 10 | df <- data.frame(
var = c('x[1]', 'x[2]', 'x[3]', 'alpha'),
value = c(1,2,3,4)
)
library(ggplot2)
ggplot(df) +
geom_point(aes(x = var, y = value)) +
scale_x_discrete(label = label_parse)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.