I want to highlight three graphs in the rows of one column using ggplot2, as shown 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 solution. Most importantly, I want to control the scales of the x and y axes, in this case make them the same, i.e. One unit should measure the same distance on both the x-axis and the y-axis.
The second problem is colliding matrices for the y axis of faceted graphs. Bonus points for solving this, but full credit for the problem of scale / aspect ratio.
source
share