From 44fccc093032ed6d112b7590e026192a6a5879a2 Mon Sep 17 00:00:00 2001 From: Francesca Mancini Date: Fri, 14 Sep 2018 17:16:04 +0100 Subject: [PATCH] Add median to violin plots --- Visualisations.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Visualisations.R b/Visualisations.R index f56caa1..59c6b15 100644 --- a/Visualisations.R +++ b/Visualisations.R @@ -130,7 +130,8 @@ length_business <- count(all_sims_socioecon, c("id", "trends", "tourists", "mana ggplot(data = length_business) + geom_jitter(aes(x = tourists, y = freq), shape = 20, color = "black", size = 1) + - geom_violin(aes(x = tourists, y = freq, fill = tourists), alpha = 0.8, draw_quantiles = 0.5) + + geom_violin(aes(x = tourists, y = freq, fill = tourists), alpha = 0.8) + + stat_summary(aes(x = tourists, y = freq), fun.y="median", geom="point") + scale_fill_manual(values = pal, name = "Type of tourists") + ylab("Years in business") + xlab("Type of tourists") +