I am trying to plot two side by side plots with ggplot. However, as the two data sets contain different number of observations, the width of the grid is automatically adjusted so that the overall width of the two plots is the same.
However, I need to have the same width between each vertical line-segment on the plot and different total widths to reflect the different sample size in the two cases.
Thanks in advance for any advice.
Here is my code
dat1 <- data.frame(a=1:10,b=letters[1:10])
dat2 <- data.frame(a=1:6, b=letters[12:17])
require(gridExtra)
plot1 <- ggplot(dat1, aes(x=b, y=a)) + geom_point(size=4)
plot2 <- ggplot(dat2, aes(x=b, y=a)) + geom_point(size=4)
grid.arrange(plot1, plot2, ncol=2)