【发布时间】:2015-12-30 21:28:00
【问题描述】:
这是可重现的代码和平 如果你运行它,你会看到它打印了一个带有两个蓝点的地图。我想添加一个单独的点(不同的样式、颜色和形状)固定点。我尝试了第二个 geom_point 但不幸的是这只是给我一个警告。 你能帮我么? 问候 亚历克斯
require("ggplot2")
require("ggmap")
jet.colors <- colorRampPalette(c("#00007F", "red", "#007FFF", "yellow", "#7FFF7F", "cyan", "#FF7F00", "blue", "#7F0000"))
bbox<-c(-0.1505833, 51.5117722, -0.1363361, 51.5188167)
mp <- get_stamenmap(bbox, maptype = "toner", zoom = 16)
# prepare data points to plot
# First Set
dfE<-data.frame(c(-0.1456250,-0.1442639),c(51.51476,51.51492),c(0.018878676,0.111847050))
names(dfE) <- c("Longitude", "Latitude", "Error")
# Second Set
stationaryPoint<-data.frame(0.1422361,51.51516)
names(stationaryPoint) <- c("Longitude", "Latitude")
ggmap(mp, darken = 0) + geom_point(aes(Longitude, Latitude, colour =Error), data = dfE, size = 10)+geom_point(aes(Longitude,Latitude),data=stationaryPoint)
【问题讨论】: