Ah, I didn't think about grDevices. Thank you!
I'm looking to use something different than the built-in color palettes in Seurat, but I'm finding it very difficult to find packages that can handle 20+ discrete colors. I've looked through RColorBrewer and colorspace, as well as ggsci, and all max out around 12 colors from what I can see. Does anyone know of other color packages that can handle a higher number of colors, or am I best off using scale_color_manual() and doing it myself in ggplot2?
1 answer
am I best off using scale_color_manual() and doing it myself in ggplot2
Yes.
Keep in mind though that there is a reason for the limit of discrete colors! It's not the computers or tools that have a problem distinguishing more than 12 discrete colors, it's the human perception that tends to be the limiting factor here!
That being said -- I don't know why you find that RColorBrewer is limited.
> library(RColorBrewer)
> colorRampPalette(rev(brewer.pal(n = 7, name = "RdYlBu")))(20)
[1] "#4575B4" "#5D8CC0" "#75A3CC" "#8DBBD8" "#A5CCE2" "#BEDDEB" "#D7EDF4" "#E6F5EC" "#F0F9DA" "#FAFDC8" "#FEFAB7"
[12] "#FEF0A8" "#FEE699" "#FDD78A" "#FDBD78" "#FCA267" "#FA8856" "#EE6A46" "#E24D36" "#D73027"
Log in to answer this question.