When ploting 2 lines on one plot with ggplot(geom_line) the color of the line doesn't compre to the color that I set. I want the lines black and blue, but the outcome is red and blue. I tried it without (first code) and with (second) 'scale_color_manual', also tried with colour insted of color, with the same result:
fisrt code:
ggplot(data=main_data) +
# black plot
geom_line(aes(x=vectors_growth_rate_with_predator,
y=disease_prevalnce_with_predator,
color = "black")) +
# blue plot
geom_line(aes(x=vectors_growth_rate_with_predator,
y=disease_prevalnce_without_predator,
color = "blue"))
second code:
PrevVSGrowth =
ggplot(data=main_data) +
# black plot
geom_line(aes(x=vectors_growth_rate_with_predator,
y=disease_prevalnce_with_predator)) +
# blue plot
geom_line(aes(x=vectors_growth_rate_with_predator,
y=disease_prevalnce_without_predator))
PrevVSGrowth + scale_color_manual(values=c(disease_prevalnce_with_predator= 'black',
disease_prevalnce_without_predator = 'blue'))