【发布时间】:2016-10-06 18:02:36
【问题描述】:
我试图理解为什么 facet_grid() 和 facet_wrap() 的输出不同,即使输入相同:
facet_grid
ggplot(temp, aes(x = valor)) +
geom_histogram(binwidth = 5, fill = NA, color = "black") +
facet_grid(estratificacao ~ referencia, scales = "free") +
scale_x_continuous(breaks = seq(0, 100, 10)) + theme_classic()
facet_wrap
ggplot(temp, aes(x = valor)) +
geom_histogram(binwidth = 5, fill = NA, color = "black") +
facet_wrap(estratificacao ~ referencia, scales = "free") +
scale_x_continuous(breaks = seq(0, 100, 10)) + theme_classic()
请看,scales = "free" 参数对于 facet_grid() 和 facet_wrap() 的行为不同。有什么可以解释的?
【问题讨论】:
-
总有lattice包can do any free scales on grid。
标签: r ggplot2 facet-wrap