如何更改分层geom_line图中的线条颜色?

时间:2017-02-22 16:38:23

标签: r plot ggplot2

我对ggplot2很新,到目前为止已经成功创建了一个3层的geom_line图。 由于该图表适用于我的色盲管理员,因此线条颜色必须改变(尤其是红色和绿色)。我尝试了不同的东西,但无法让它发挥作用。有什么好建议吗?

谢谢!

p = ggplot() + 
    geom_line(data = my_data, aes(x = E, y = N50_A, colour = "A")) +
    geom_line(data = my_data, aes(x = E, y = N50_C, colour = "C")) +
    geom_line(data = my_data, aes(x = E, y = N50_D, colour = "D")) + 
    xlab('E') + ylab('N50') + 
    theme_bw() + ggtitle("E90N50") +
    theme(legend.position = "bottom", 
          legend.title = element_blank(), 
          plot.title = element_text(hjust = 0.5)) 

p

Here is the resulting plot

0 个答案:

没有答案