I need a lot of graphs to display horizontally. I tried many ways and found grid.arrange to be encouraging, except for problems with the x-axis label.
library(ggplot2) library(gridExtra) x1 = c("x","x","y","x","y","x") x2 = c("NicholasKimseyLayerDad","GumpedJinseiLacks","NicholasKimseyLayerDad","NicholasKimseyLayerDad" ,"GumpedJinseiLacks","GumpedJinseiLacks") fail = c("F","P","F","F","P","F") D1=data.frame(x1,fail) p1 = ggplot(D1,aes(x=x1,fill=fail)) + geom_bar() +geom_text(stat='bin',aes(label=..count..),vjust=-0.3,size=4,color="red")+ theme(legend.position="none",axis.title.y=element_blank(),axis.text.x = element_text(angle = 90, hjust = 1)) p2 = ggplot(D1,aes(x=x2,fill=fail)) + geom_bar() +geom_text(stat='bin',aes(label=..count..),vjust=-0.3,size=4,color="red")+ theme(legend.position="none",axis.title.y=element_blank(),axis.text.x = element_text(angle = 90, hjust = 1)) grid.arrange(p1,p2,ncol=2)

Please run the code and I really appreciate it.
Is it necessary to fix the height of the graphs so that the labels on the x-axis start from the same height? Thank you very much.