Change the color of the RidgePlot
1
0
Entering edit mode
3.7 years ago
yueli7 ▴ 250

Hello,

I want to change the healthy control into green color, and severe into red color.

Thanks in advance for any help!

Best,

Yue

Screenshot-from-2020-09-02-06-01-07

> RidgePlot(Basal, features = c("MAFF"),group.by="tech") + theme(axis.title.y = element_blank())
Picking joint bandwidth of 0.0865
> RidgePlot(Basal, features = c("MAFF"), cols.use = c("green","blue","red"),group.by="tech") + theme(axis.title.y = element_blank())
Error in RidgePlot(Basal, features = c("MAFF"), cols.use = c("green",  : 
unused argument (cols.use = c("green", "blue", "red"))
RNA-Seq R seurat • 2.4k views
ADD COMMENT
3
Entering edit mode
3.7 years ago

Hi,

Did you try cols argument instead of cols.use. I guess this might depend on the Seurat version that you have.

So, I tried the following and it works:

library("Seurat")
packageVersion("Seurat") # ‘3.1.5’
data("pbmc_smal") # import example data
RidgePlot(object = pbmc_small, features = 'PC_1', cols = c("red", "blue", "green")) # plot ridge plot

Result:

enter image description here

c("red", "blue", "green") follows the order at c("severe", "mild", "healthy_control").

I hope this answers your question,

António

ADD COMMENT
0
Entering edit mode

Hello antonioggsousa,

Thank you so much for your great help!

Thank you!

Best,

Yue

ADD REPLY
0
Entering edit mode

You're welcome!

Do not forget to:

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work. This will help further users that might find this post useful to find the right answer.

enter image description here

Cheers,

António

ADD REPLY
0
Entering edit mode

Sorry about that!

Thank you again!

Yue

ADD REPLY
0
Entering edit mode

This will help further users that might find this post useful to find the right answer

I like the last part that you've added to our template. Mind if I steal it and make it part of the template?

ADD REPLY
0
Entering edit mode

Hello RamRS.

Of course, It is my pleasure.

Best,

Yue

ADD REPLY
0
Entering edit mode

Thanks but I’m asking Antonio. Sorry about the confusion!

ADD REPLY
0
Entering edit mode

Hi @RamRS,

Yes, of course you can use.

I was the one that steal it from you.

António

ADD REPLY

Login before adding your answer.

Traffic: 2762 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6