Point color (col) and fill color (bg) by group in stripchart

后端 未结 3 2086
余生分开走
余生分开走 2020-12-11 19:44

I\'m trying to reproduce the following image image http://www.davidzeleny.net/wiki/lib/exe/fetch.php/vizualizace:figures:boxplots-jitter-rdbu-colors.png?cache=

The c

3条回答
  •  伪装坚强ぢ
    2020-12-11 20:34

    Not the most elegant way, but hey, it's working

    boxplot(melt$value ~ melt$variable, notch=T, col=c(bpColor[1], bpColor[4]), outline=F, varwidth=T)
    stripchart(melt[melt$variable == "a", "value"] ~ melt[melt$variable == "a", "variable"], add=T, vertical=T, pch=21, bg=c(bpColor[2]), method='jitter', jitter=0.02)
    stripchart(melt[melt$variable == "b", "value"] ~ melt[melt$variable == "b", "variable"], add=T, vertical=T, pch=21, bg=c(bpColor[3]), method='jitter', jitter=0.02)
    

    enter image description here

提交回复
热议问题