Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R ggplot2中的多面板绘图:比例为;“自由平等”吗;?_R_Ggplot2 - Fatal编程技术网

R ggplot2中的多面板绘图:比例为;“自由平等”吗;?

R ggplot2中的多面板绘图:比例为;“自由平等”吗;?,r,ggplot2,R,Ggplot2,我已向ggplot图形发出以下命令: facet_wrap(~variable,scales="free") 但我也希望每个面板的x和y比例相等(而限制因面板而异)。这在ggplot2中可能吗?如果使用facet\u grid,可以指定space='free'。我想这就是你想要的 require(ggplot2) x = 1:9 group = rep(1:3, each=3) data = data.frame(x, group) qplot(x, x, data=data) + face

我已向ggplot图形发出以下命令:

facet_wrap(~variable,scales="free")

但我也希望每个面板的x和y比例相等(而限制因面板而异)。这在ggplot2中可能吗?

如果使用
facet\u grid
,可以指定
space='free'
。我想这就是你想要的

require(ggplot2)

x = 1:9
group = rep(1:3, each=3)
data = data.frame(x, group)
qplot(x, x, data=data) + facet_grid(~group, scales='free', space='free')

谢谢,但实际上这将所有y轴限制设置为(1,9),x轴间隔设置为3(每个面板的限制不同)。如何分别将面板1中的x轴和y轴限制设置为(1,9)和(1,9),以及面板2中的x轴和y轴限制设置为(1,3)和(1,3),依此类推?对于facet_grid,同一列中所有面的x轴必须相同,同样,同一行中所有面的y轴必须相同。查看和中的示例,但听起来您可能遇到了ggplot2的限制。