Juliet Hannah
2008-Oct-30 15:16 UTC
[R] combine symbol beta and text in ggplot2 and adjust size
For this example: library(ggplot2) p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() p <- p + scale_x_continuous(expression(beta)) p How can I include text with the expression. For example, "level of \beta". Also, how can I increase the size of the font for this axis label. Thanks, Juliet
hadley wickham
2008-Oct-30 15:26 UTC
[R] combine symbol beta and text in ggplot2 and adjust size
> For this example: > > library(ggplot2) > p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() > p <- p + scale_x_continuous(expression(beta)) > p > > How can I include text with the expression. For example, "level of > \beta". Also, how can I increaseHave a look at ?plotmath - you want something like expression(paste("Level of ", beta))> the size of the font for this axis label.See http://had.co.nz/ggplot2/book/polishing.pdf Hadley -- http://had.co.nz/