I have a scatterplot of mtcars and I was wondering if there is way to specify the color of the points corresponding to the maximum and minimum mpg values. I guess a broader way to ask the question would be is there a way to assign point color based on subgroups, ie 3 most efficient cars in green and 3 least efficient cars in red?
plot(mpg~hp, col= "red", data= mtcars)
thank you!