简体   繁体   English

从ggmap点反转colors

[英]Reverse colors from ggmap points

I want to reverse the color of the points and the label from the following ggmap creation:我想从以下 ggmap 创建中反转点和 label 的颜色:

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在以下位置找到答案: 反转默认比例梯度 ggplot2

Simply switched place with the found R color default pallete for the case:只需使用找到的 R 颜色默认调色板切换位置即可:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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