why isn't its color blue?

ggplot(mpg, aes(x = displ, y = hwy, color = "blue")) + geom_point()

If you define color = "blue" inside the aes() function you are mapping the color aesthetic to a factor containing the "blue" label, if you want to set the color instead, you have to do it outside the aes() function, see this example.

library(ggplot2)

ggplot(mpg, aes(x = displ, y = hwy)) +
    geom_point(color = "blue")

Created on 2019-11-29 by the reprex package (v0.3.0.9000)

3 Likes

Thanks a lot
I will try it

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.