我看過
如果我不指定group=1我會得到顏色,但點是堆疊的:
ggplot(dfc, aes(color=g, fill=g)) geom_dotplot(aes(x=r), binwidth = 0.2)

我可以接近ggstance::position_dodgev(),但不完全是:
ggplot(dfc, aes(color=g, fill=g)) geom_dotplot(position=ggstance::position_dodgev(height=0.025), aes(x=r), binwidth = 0.2)

uj5u.com熱心網友回復:
我想這可能就是你要找的。如果這不是您要找的答案,請告訴我
ggplot(dfc, aes(x=r, y=g, color=g, fill=g))
geom_dotplot(stackgroups = TRUE, binwidth = 0.25, method = "histodot")
scale_x_continuous(breaks = seq(from = 2, to = 10, by = 2))

uj5u.com熱心網友回復:
按照問題中的帖子鏈接并經過一些反復試驗,我想出了這個。
library(ggplot2)
ggplot(dfc, aes(x=r))
geom_dotplot(
aes(color = g, fill = g),
stackgroups = TRUE,
binpositions = "all",
binwidth = 0.2
)

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/364781.html
上一篇:如何創建相同的雙離散y軸
下一篇:減少r中的字串
