-1

I am trying to create a linegraph showing population change over time for two species. I managed to create the graph how I want it to be and am now trying to alter the aesthestics for a public poster. I am trying to change the colors and the legend to be more coherent, but when I try to change it a second legend is created. See the picture below. The top legend is the default one and the bottom is the one that I want.

Image of code and resulting graph: (https://i.sstatic.net/XWICmT2c.png)

I tried to delete the orignal legend and then insert the new one but when I tried that, the new legend would not show up. Any suggestions?

New contributor
Lauren Benedict is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • 2
    See this answer for how to combine the 2 legends into 1.
    – shaun_m
    Commented Jul 2 at 19:13
  • 3
    Welcome to Stack Overflow! Please add code and data as text (using code formatting), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and many more reasons. Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data.
    – M--
    Commented Jul 2 at 19:15

1 Answer 1

-1

You should only need scale_color_manual for the lines.

As far as removing one of the guides, your best bet is likely to use a line in ggplot2 to forcibly remove the top one. Something like:

"+ guides(linetype = FALSE)"

New contributor
rachelgriffard is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.