logo-MindMajix
r
ravi sankar

Posted on 21st July 2024|118 views

0
votes

Ggplot Add Legend

How to add the legend to ggplot2?

1 answers
Answers
P
Surya kumar

Posted on 21st July 2024| views

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
Name
Course *
Email *
Phone Number