首页 > 解决方案 > GGPlot 刻面 X 标签

问题描述

library(ggplot2)
d <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
  xlim(0, 2) + stat_binhex(na.rm = TRUE) + theme(aspect.ratio = 1)

d + facet_wrap(~ color)

这里产生

在此处输入图像描述

如果您希望每列下的 XLABEL 居中,如下所示:

在此处输入图像描述

标签: rggplot2facet-wrap

解决方案


推荐阅读