2

Using library(tidyverse), fix this code by making the point blue instead of red:

ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy, colour = "blue")) 

Not sure where where to input the code to change it to blue instead of red, can anyone explain why it is default red and what the code would look like to change the colour?

4
  • The colour argument should be out of the mapping argument : ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy), colour = "blue") Commented Sep 30, 2021 at 15:12
  • Found out how to change the initial code into blue points but how to I keep the legend in? Currently looks like: 1. ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy), color = "blue") Commented Sep 30, 2021 at 15:13
  • @Basti how would you keep the legend visible with that? Commented Sep 30, 2021 at 15:15
  • 1
    This page may help give you some of the answers you are looking for: stackoverflow.com/questions/55301575/… Commented Sep 30, 2021 at 15:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.