R 如何控制分面ggplot2绘图的纵横比和比例?

R 如何控制分面ggplot2绘图的纵横比和比例?,r,ggplot2,R,Ggplot2,我想使用ggplot2在一列的行中刻面三个图,如下所示 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 库(ggplot2) df我认为您正在寻找coord\u fixed library(ggplot2) df <-

我想使用ggplot2在一列的行中刻面三个图,如下所示

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
库(ggplot2)

df我认为您正在寻找
coord\u fixed

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 + coord_fixed(ratio=1)
库(ggplot2)
df