r
ravi sankar

Posted on 25th September 2022|19 views

0
votes

Ggplot Add Legend

How to add the legend to ggplot2?

Answers
P
Surya kumar

Posted on 25th September 2022

You can add it this way for example if you are adding colours of lines in the graph

ggplot(dd) + geom_line(aes(x=fecha, y=value, colour=variable)) + scale_colour_manual(values=c("orange","blue","graeen"))

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos