r - leading superscript in plotmath expression (w/ggplot2) -
i'd use plotmath create axis containing leading superscript in ggplot2 plot. creating superscripts on axis labels works nicely, so:
require(ggplot2) ggplot(mtcars, aes(x=disp, y=mpg)) + geom_point() + ylab(expression(x[y])) 
however, i'd have axis label read "y(superscript)x" - logically ^yx, won't parse:
error: unexpected '^' in: " geom_point() + ylab(expression(^" is there way force superscript @ beginning of statement?
how this:
ggplot(mtcars, aes(x=disp, y=mpg)) + geom_point() + ylab(expression(phantom(0)^y * x)) i there must way "placeholder" character, had scroll down bit in ?plotmath find it.
Comments
Post a Comment