我知道,3D 条形图是一种罪过。但我被要求这样做,作为一种权衡,我建议只制作一个比顶部和右侧的栏颜色稍深的边框。这样,条形图就会有某种“阴影”(呃),但至少你仍然能够比较它们。
有什么办法可以做到这一点吗?
ggplot(diamonds, aes(clarity)) + geom_bar()
另一种可能性,使用两组geom_bar
。第一组,绿色的,稍微高一些并且向右偏移。我从@Didzis Elferts 借用了数据。
ggplot(data = df2) +
geom_bar(aes(x = as.numeric(clarity) + 0.1, y = V1 + 100),
width = 0.8, fill = "green", stat = "identity") +
geom_bar(aes(x = as.numeric(clarity), y = V1),
width = 0.8, stat = "identity") +
scale_x_continuous(name = "clarity",
breaks = as.numeric(df2$clarity),
labels = levels(df2$clarity))+
ylab("count")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)