[R] ggplot2 boxplot points (size,color,shape)

Brian Smith bsmith030465 at gmail.com
Tue Mar 17 15:04:21 CET 2015


Hi,

I am trying to create a boxplot (with geom_jitter) such that the points
from one set of values are shown as circles, and the second set of points
also as circles, but with no fill. In other words, how can I control the
shape and color for the points appearing in this boxplot?

=======
library(ggplot2)

myvect1 <- rnorm(100)
myvect2 <- rnorm(100)

fill1 <- rep('solid',100)
fill2 <- rep('solid',100)

myvect <- c(myvect1,myvect2)
myfill <- c(fill1,fill2)

mydat <- data.frame(myvect,myfill)

## How can I control the shape, color of the points in the boxplot based on
the values of myfill?
ggplot(data=mydat,aes(x='test',y=myvect)) + geom_boxplot() + geom_jitter()

==========

thanks!!

	[[alternative HTML version deleted]]



More information about the R-help mailing list