label_parse.Rd
ggplot2 labeller function for plotmath labels.
To be used in ggplot2 scale_*_ functions as the label
argument.
label_parse(labels)
labels | character vector of labels to be parsed |
---|
a list of expressions
It is useful when breaks are plotmath-ready character vectors. This function correctly formats them in order to be parsed and displayed as expressions.
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)