r - Expression of italics and superscripts in ggplot axis title -


i sorry ask this, can't seem expression right include in ylab() or xlab() arguments of ggplot2-object. needs read:

"2q (rarefied)". "2" needs superscripted, though.

i have fiddled expression() , paste(), seems impossible. appreciated.

edit: example:

dat<-as.data.frame(matrix(runif(100), 10,10)) names(dat) <- letters[1:10]  library(ggplot2) ggplot(dat, aes(a,b)) +   geom_point()+   xlab("some title") 

all necessary information can found in help("plotmath").

ggplot(dat, aes(a,b)) +   geom_point()+   xlab(expression({}^2*italic(q)~textstyle(group("(", rarefied, ")")))) 

resulting plot


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -