I want to facet three plots in rows of a single column using ggplot2, as illustrated below.
library(ggplot2)
df <- data.frame(x=rep(1,3), y=rep(1,3), z=factor(letters[1:3]))
p <- ggplot(df, aes(x, y)) + geom_point() + facet_grid(z ~ .)
p
There are two problems with this output. Most importantly, I want to control the scales of the x and y axes, in this case to make them the same i.e. a single unit should measure the same distance on both x and y axes.
The second issue is the colliding lables for y axis of the facetted plots. Bonus points for solving that, but full credit for the scale/aspect ratio problem.
I think you are looking for
coord_fixed