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])) 

enter image description here

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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -