简体   繁体   中英

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:

地图

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

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM