0

I am having some trouble while trying to set the colors of my jitters points, when plotting some boxplot.

The idea is that I want to compare the outliers from two boxplots, and see if somehow they are related to each other. To do this I create a dataframe comparative that contains all the values needed for the comparison, additionally. I create a new column of labels that will help me to identify the outliers of interest of one of the boxplots. All values below 1.5 are CD3 outliers and below they are CD3 Normal.

comparative[,"label"] <- NA
comparative[comparative$AllDataMedian > 1.5, "label"] <- "CD3Outliers"

comparative[comparative$AllDataMedian <= 1.5, "label"] <- "CD3Normal"

Mcomparative <- melt(comparative)

c <- ggplot(Mcomparative, aes(variable, value))

c + geom_boxplot(outlier.shape = NA) + geom_jitter(shape=16, position=position_jitter(0.1), aes(colour=label))

with this I get

enter image description here

I'm quiet happy with it, however I would like to change those default colors. I hope someone can help me.

Thanks.

Babas
  • 377
  • 3
  • 16

0 Answers0