我正在尝试理解为什么
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()
上的行为不同。有什么可以解释这个现象吗?