I am trying to create a visualisation of read-length distribution using ggplot2, but I have an awkward prime-number of samples ( 17 ), so I cannot get scales underneath each column.
Does anyone know how I would add x scales to the MS10134, MS10135, and MS10136 samples specifically.
If I change the facet_wrap to "free_x" I will get scales underneath each plot, which isn't what I want.
The code and a image of the plot are below.
p = map_q %>% ggplot(aes(read_length,fill=name)) +
geom_density() +
facet_wrap(~name,ncol=4,nrow=5) +
theme_bw() +
theme(legend.position="none") +
scale_x_continuous(breaks=pretty_breaks(10)) +
xlab("Read Length") +
ylab("Mapped read density") +
ggtitle("Merged Read Length Distributions")
If it is not possible I can always revert to inkscape.
Thanks for your time.
I moved this to an answer so it's easy to bookmark :)
I was searching using the incorrect keywords. Thanks!