How to assign colors to categorical variables in ggplot2 that have stable mapping?

后端 未结 5 896
[愿得一人]
[愿得一人] 2020-11-22 08:46

I\'ve been getting up to speed with R in the last month.

Here is my question:

What is a good way to assign colors to categorical variables in ggplot2 that ha

5条回答
  •  孤独总比滥情好
    2020-11-22 09:18

    This is an old post, but I was looking for answer to this same question,

    Why not try something like:

    scale_color_manual(values = c("foo" = "#999999", "bar" = "#E69F00"))
    

    If you have categorical values, I don't see a reason why this should not work.

提交回复
热议问题