I am trying to put Greek characters in my boxplot made in ggplot2. However, having gone through all the previous questions about stack overflows, I cannot get any of my examples for work for life.
So I apologize for the repost, but if someone can help me, I will be very grateful.
My code so far:
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))
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)
What gives:

There are several bits in the code needed for my real data (i.e. reorganization of the x axis (which is the y axis), etc.)
I want the legend to change to Greek letters, but I am absolutely fixated on how to do this.
thanks
source
share