Hi, I am making a boxplot on insect species.
The only thing that does not work for me at the moment, is splitting the plot into terrestrial and aquatic species.
The dataset that I use for making the graph consists of the following columns: taxon_order, value, variable and area.
The area column contains information on whether the insect is terrestrial (Coleoptera, Hymenoptera and Lepidoptera) or aquatic (Ephmeroptera, Odonata, Plecoptera). I would like to display this information on the x-axis as well, but do not know and cannot find how.
This is my current graph:
and this is my code:
ggplot(fig1_combined, aes(x=taxon_order, y=value, fill=variable))+ geom_boxplot(alpha =1)+ labs(x = "Taxon order", y ="Percentage (%)")+ scale_fill_manual(values = fillcolors, name="test", breaks = fill_variable, labels = grouplabels) + guides(fill=guide_legend(title = NULL))+ theme(text = element_text(size = 16))+ theme_classic()
Can someone help me?