Adding geom_line legend in ggplot

        C <- ggplot(farnorth, aes(x = month, y = Temperature))+
           geom_boxplot(data = farnorth, fill = "grey", alpha = 0.5)+
           geom_line(data = mean_temp3, aes(y = plus_one_degree, group = 1), colour =      "#D55E00")+
           geom_line(data = mean_temp3, aes(y = plus_two_degrees, group = 1), colour = "darkblue")+
           geom_line(data = mean_temp3, aes(y = plus_three_degrees, group = 1), colour=    "#009E73")+
           labs(x = "Months", y = "Sea temperature in °C")+
           scale_y_continuous(limits = c(0,22),
                     breaks = seq(0,22,4))+
           theme_light()

I want to add a legend for the the 3 geom_lines.

ex: First geom_line = "Mean +1"
Second geom_line = "Mean +2"
Third geom_line = "Mean +3"

Take a look at this related topic Adding manual legend to ggplot2 - #3 by andresrcs

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.