Multi-line ggplot for long data sets with legend

It is nice of you trying to share what you have learned and it is not my intention to criticize you but the way you have achived the plot is not considered the best approach. It would be better to reshape your data into a long format using tidyr before plotting. If you are interest in this approach, please post a proper REPRoducible EXample (reprex) including sample data and we can go from there.