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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -