【发布时间】:2020-03-25 17:28:25
【问题描述】:
我在这个情节上有两个问题。我想让条形更宽(组之间的间距更小),并且我希望每组条形都以每个 x 因子值为中心。
我在 y 轴上有一个连续变量,在 x 轴上有一个因子值。对于每个因素,我分为三组。
这是我的虹膜数据问题的一个示例:
d <- iris
ggplot(d) +
geom_col(aes(x=as.factor(Sepal.Length), y=Petal.Width, fill=as.factor(Species)),position = position_dodge(preserve = "single"), width=1) +
theme(axis.text.x = element_text(angle = 90).
【问题讨论】: