n
naseer mohammad

Posted on 28th March 2024|396 views

0
votes

Scale Color Manual

What changes should I do if my scale_color_manul() is not working?

see the below code the scale_color_manul() is not working

ggplot(df, aes(x=cond, y=yval)) + geom_point() + scale_color_manual(values=c("green", "yellow", "orange"))

 

Answers
P
James ROBERT

Posted on 28th March 2024

You just need to map color to the variable like this

ggplot(df, aes(x=cond, y=yval, color = cond)) + geom_point() + scale_color_manual(values=c("green", "yellow", "orange"))

 

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