I make a plot of Cumulative distribution functions of seven distributions. However, it does not show all the elements of the legend. The plot looks like this:
The distribution does not show "Distribution" in full. Can anyone tell me how to solve this?
The code looks like this:
ggplot(df, aes(x, colour = Distribution)) + stat_ecdf() + scale_color_discrete(labels = c("N(0, 2)", 'Laplace(0, 1)',
TeX("$0.85N(0, 0.2) + 0.15N(0, 20)$"),
'Gamma(0.05, 0.1)', 'Exp(0.9)', TeX("$F_{3, 8}$"), TeX("$P(mu_i=0) = 0.95, P(mu_i=8) = 0.05$"))) +
xlim(-3, 3) +
xlab("Value") +
ylab("Cumulative Density Function") +
theme(legend.text.align = 0, legend.position="bottom", legend.text=element_text(size=10))
Also, I do not want to change the position of legend. Because the plot can be too narrow if put the legend left or right side.