How to print angstrom square in x axis? I tried as follows. I am really sorry for my simple question.
labs(x = "x axis" (Å^2)", y = "y axis")
How to print angstrom square in x axis? I tried as follows. I am really sorry for my simple question.
labs(x = "x axis" (Å^2)", y = "y axis")
We can use bquote
library(ggplot2)
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
labs(x = bquote('x axis'~(Å^2)), y = "y axis") +
#or
#labs(x = bquote('x axis'~(ring(A)^2)), y = "y axis")
theme_bw()
You should use expression, preferable combined with paste, as follow:
ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs(x = expression(paste("x axis ", ring(A)^2)), y = "y axis")