Search code examples
rcolorsggmap

Reverse colors from ggmap points


I want to reverse the color of the points and the label from the following ggmap creation:

ggmap(Map) +
  geom_point(data = DF, aes (x = Longitude, 
                                y = Latitude, 
                                color = RPM)) +
  labs(y = "Latitude", x = "Longitude", color = "RPM")

I wouldn't like to change by now the data set to spatial points.

I'm getting the following result:

Map

I have tried the following addition to the code presented:

scale_colour_brewer(direction = -1)

But I'm getting the following error message:

Error: Continuous value supplied to discrete scale


Solution

  • Found the answer at: Reversing default scale gradient ggplot2

    Simply switched place with the found R color default pallete for the case:

    scale_fill_continuous(high = "#132B43", low = "#56B1F7")