This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Change the color of the RidgePlot

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

1 answer

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

Hello antonioggsousa,

Thank you so much for your great help!

Thank you!

Best,

Yue

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

Sorry about that!

Thank you again!

Yue

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?

Hello RamRS.

Of course, It is my pleasure.

Best,

Yue

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

Hi @RamRS,

Yes, of course you can use.

I was the one that steal it from you.

António

Log in to answer this question.