I am trying to put greek symbols in my boxplot made in ggplot2. However after going through all the previous questions on stack-overflow I cannot for the life of me get any of their examples to work.
So apologies for the repost, but if someone could help me out here I would be most appreciative.
My Code so far is:
## Data
names = LETTERS[1:3]
x = runif(99)
y = rep(names, length = length(x))
Parameters = factor(rep(c("Lambda", "Phi", "Gamma"), each = length(names)),
levels = c("Lambda", "Phi", "Gamma"))
plot.df = data.frame(x, y, Parameters)
limits = quantile(plot.df[,1], probs = seq(0.1,0.9,by=0.1))
##Create Plot
dodge = position_dodge(width=0.5)
p = ggplot(plot.df, aes(x = y,y = x, colour = Parameters)) +
geom_boxplot(aes(shape = Parameters), outlier.shape = 19, outlier.colour = NULL, outlier.size = 0.8) +
scale_shape_manual(values = rep(19, 3)) +
scale_y_continuous(limits = c(0, 1)) +
coord_flip() + labs(title = "TITLE", x = "", y = "") +
xlim(rev(names)) +
theme(legend.position = "right")
print(p)
Which gives:
There are a number of bits in the code that are necessary for my real data (ie. reorganizing of the x axis (which is the y axis) etc.)
I want the legend values to change into the greek letters, but I am absolutely stumped on how to do this.
Thanks