I'm trying to improve a simple but important detail in my facet_grid graphic.
I played with scale and space parameteres of facet_grid() function. But I would like to increase the height only for the bottom facet in order to be possible to read the sample count that appears cut off in the graph (highlighted in red). See Image1. The code used is:
ggplot(salm_data, aes(x=SALM) ) + geom_bar(stat = "count", position = position_dodge())
+ facet_grid(YEAR ~ TYPE, scales = "free_x", space = "free")
+ geom_text(size=2.5, stat = "count", aes(label = after_stat(count)), vjust = -0.3) +theme_bw() + labs(y="Number of samples") +
theme(panel.grid.minor = element_blank())+
labs(x=expression(paste(italic("Klebsiella spp."), " ")))
Image 1: Image1
To try to overcome this "problem" I tried including next code to enlarge the Y-axis:
scale_y_continuous(breaks = seq(from = 0, to = 300, by = 40))
But I'm not capable to improve the situation (see Image2).
Image 2: Image2
Could you help me with some ideas to overcome this scenario?
Thanks on advance for your help/comments,
Magi