I would like to create a bar plot with ggplot2 in which the discrete values of the x axis would be grouped into subgroups (see picture attached – the picture is from the web I do not have a code for the plot yet).
Thanks for your help !
ggplot2groupingr
I would like to create a bar plot with ggplot2 in which the discrete values of the x axis would be grouped into subgroups (see picture attached – the picture is from the web I do not have a code for the plot yet).
Thanks for your help !
Best Answer
Two approaches:
Example data:
Without facetting:
With facetting:
Facetting has the obvious advantage of not having to muck about with the positioning of the labels.