how to reverse colors on boxplot

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to reverse colors on boxplot

anikaM
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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to reverse colors on boxplot

Rui Barradas
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
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.