Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Color points in overlayed scatterplots in ggplot R [duplicate]

$
0
0

Using this tibble as example:

tibble(
  groups = c("a","b","c","d","e"),
  grade1 = c(510,405,308,201,99),
  grade2 = c(520,430,300,190,110),
  grade3 = c(530,410,320,210,105)
)

How do I manage to color the points according to the grade # using geom_point? I've tried plotting it like this...

ggplot(aes(x=groups)) +
    geom_point(aes(y=grade1))+
    geom_point(aes(y=grade2))+
    geom_point(aes(y=grade3))

...and color="red", or any other color, always leads to the same shade of orange.


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>