Hi, this is my first post. I've been looking for answers here and there but i can´t solve this:
I have some data that is plotted with ggplot as dots. Then i created a data frame that contains the values of a line that i need to plot in the previous plot. It works well with my code but i cant see the name of the line in the legend box. Thanks in advance.
To help us help you, could you please turn this into a proper reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
I think the problem is that for geom_line() you defined color not inside of aes(), hence there is no mapping for the line in legend. If you add color = lin it probably would work.