a_t*_*d12 1 r facet ggplot2 facet-wrap
例如,如果您有 7 个面板并且指定facet_wrap(~model, nrow = 3)
ggplot 将默认为 3x3x1 布局。是否可以让 ggplot 执行 3x2x2(或 2x2x3 等)?
您可以使用ggh4x
指定方面design
的:
library(ggh4x)
design = matrix(c(1, 1, 2, 2, 3, 3,
4, 4, 4, 5, 5, 5,
6, 6, 6, 7, 7, 7),
3, 6, byrow = TRUE)
ggplot(mpg, aes(displ, hwy, colour = as.factor(cyl))) +
geom_point() +
facet_manual(vars(class), design = design)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
62 次 |
最近记录: |