Using ggplot2, I want to apply a theme to the font for my y-axis label. The label is written as an expression:
g <- g + theme(axis.title.y = element_text(face="bold", colour="#000000",
size=32), axis.text.y = element_text(angle=0, vjust=0.5, size=24,
colour="#000000")) + ylab(expression(paste("Bias (R"^"2"*")")))
This command does not alter the font size or make it bold on the axis label. However, if I change the axis label to a pure string:
g <- g + ylab("blah")
Then I get a bold, size 32 blah. I suspect this has something to do with the way ggplot2 handles the expression, but would rather not use a string like "R^2" instead of the superscript. I can't seem to find good information about this online however.
Any suggestions?