I edited this plot with Inkscape, however I wonder if is there a way to do it within ggplot environment?
I did a quick search in the web without any success. Can someone give me a workaround?
I would really appreciate because I consider it a very common type of plot.
The code for this plot is:
var3 %>%
gather(-(exp:rep), key = "variable", value ="value") %>%
mutate(variable = recode(variable,
diam = "Lesion diameter",
dles = "Lesion density",
sev = "Disease severity")) %>%
ggplot(aes(x = Iso, y = value)) +
geom_boxplot(aes(fill=factor(exp)),
position = position_dodge(width = 0), alpha = 0.5,
width =0.3) +
facet_grid(variable~Cv,
labeller = labeller(Cv = label_both, variable = label_value),
scales = "free")+
scale_y_continuous(labels=scaleFUN)+
theme_juan(9, "top", "center")+
scale_fill_manual(values = c("grey70","grey30"),
labels = c("Exp. 1","Exp. 2"), name = "")
Being var3
a data frame looking like:
# A tibble: 72 x 7
exp Cv Iso rep sev dles diam
<dbl> <fctr> <fctr> <dbl> <dbl> <dbl> <dbl>
1 1 BMX_Potencia MT 1 0.17262317 1.8924050 0.2400000
2 1 BMX_Potencia MT 2 0.14700000 2.1483445 0.3000000
3 1 BMX_Potencia MT 3 0.01404289 1.3623602 0.2133333
4 1 BMX_Potencia MT 4 0.11933333 1.3160049 0.2900000