[R] how to reverse colors on boxplot

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Thu Aug 8 21:14:59 CEST 2019


Hello,

Maybe I don't understand the question but isn't all you have to do is 
to, well, reverse the colors

col = c("palevioletred1", "royalblue1")

in the boxplot call?

boxplot(flcn_M ~ subject, data = dx,
         col = c("palevioletred1", "royalblue1"),
         xlab="subjects",
         ylab="Expression estimate in delta (log2)",
         boxwex = 0.2,
         frame.plot = FALSE)
stripchart(flcn_M ~ subject, vertical = TRUE,
            data = dx,
            method = "jitter",
            add = TRUE,
            pch = 20,
            col = rgb(0, 0, 0, 0.5),
            jitter = 0.001)


Hope this helps,

Rui Barradas

Às 18:49 de 08/08/19, Ana Marija escreveu:
> Hello,
> 
> I made plot in attach using:
> 
> boxplot(flcn_M~subject,data=dx,col =
> c("royalblue1","palevioletred1"),xlab="subjects",ylab="Expression
> estimate in delta (log2)",boxwex = 0.2,frame.plot = FALSE)
> stripchart(flcn_M~subject, vertical = TRUE, data = dx,method =
> "jitter", add = TRUE,pch = 20, col=rgb(0,0,0,.5),jitter = 0.001)
> 
> How do I reverse colors so that PDR is shown in this pink and nDR in blue?
> 
> Thanks
> Ana
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list