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

后端 未结 3 2085
余生分开走
余生分开走 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 answer to the base but a ggplot approach:

    ggplot(melt, aes(fill=variable, x=variable, y=value)) +
        geom_boxplot(notch = TRUE) + 
        geom_jitter(position = position_jitter(width = .05, height =0), shape=21, size=1.5) +
        scale_fill_hue(l=40) 
    

    I couldn't figure out how to make the hue for the box fill and the point separate. Thought alpha might work but we want to change points to less intensity not more transparent. I'd appreciate an edit here for someone to fill in the missing piece.

    enter image description here

提交回复
热议问题