r - ggplot2 2.0.0 coloured boxplots and jitter with borders -


i trying make boxplot filled binary variable, facet grid. want have jitter on top of boxplots, without getting them confused outliers. in order fix this, have added colour jitter, doing so, meld in coloured boxplots, same colour.

i want keep colours same, there way add borders jitter (or there different way fix outlier problem)?

example code:

plot <- ggplot(mpg, aes(class, hwy))+    geom_boxplot(aes(fill = drv))+    geom_jitter(width = .3, aes(colour =drv))  #  facet_grid(. ~some_binary_variable, scales="free")  

you can use filled plotting symbol (21:25, cf. ?pch) , use white border differentiate points:

ggplot(mpg, aes(class, hwy))+     geom_boxplot(aes(fill = drv))+     geom_jitter(width = .3, aes(fill = drv), shape = 21, color = "white") 

enter image description here


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -