I'm trying to make a legend in a ggplot2
plot that contains a minus sign as an exponent (with no other characters in the exponent). However, I can't figure out the plotmath
syntax.
It seems like the following would work:
expr1 <- expression(paste("text", main[sub]^{-}))
ggplot(mpg, aes(x=cty, y=hwy, colour=drv)) + geom_point() +
scale_colour_discrete(labels=c(expr1, "b", "c"))
(And it does work if we say expr1 <- expression(paste("text", main[sub]^{super}))
. Is there an escape character or something for minus signs in plotmath
?