The easiest solution: use Unicode characters
expression or other packages are not needed.
Not sure if this is a newer feature for ggplot, but it works. It also makes it easy to mix Greek and plain text (for example, adding '*' to checkmarks)
Just use Unicode characters in the text string. It seems to work well for all the options I can come up with. Edit: previously it did not work in facet labels. This seems to have been fixed at some point.
library(ggplot2) ggplot(mtcars, aes(mpg, disp, color=factor(gear))) + geom_point() + labs(title="Title (\u03b1 \u03a9)", # works fine x= "\u03b1 \u03a9 x-axis title", # works fine y= "\u03b1 \u03a9 y-axis title", # works fine color="\u03b1 \u03a9 Groups:") + # works fine scale_x_continuous(breaks = seq(10, 35, 5), labels = paste0(seq(10, 35, 5), "\u03a9*")) + # works fine; to label the ticks ggrepel::geom_text_repel(aes(label = paste(rownames(mtcars), "\u03a9*")), size =3) + # works fine facet_grid(~paste0(gear, " Gears \u03a9"))

Created on 2019-08-28 by the reprex package (v0.3.0)
Matt L. Sep 13 '18 at 22:46 2018-09-13 22:46
source share