This is a sample plot for visualizing high volume density area
SHA_1214_Stop_GPS <- read.csv("C:/Users/AEE1GSS/Desktop/0311/SHA_DRIVERMAP/SHA_1214_Stop_GPS.csv")
library(ggplot2)
library(ggmap)
library(mapproj)
## Loading required package: maps
SHA_MAP_zoom12 <- ggmap(get_map(maptype = "terrain", location = "shanghai",
zoom = 12, source = "google"), base_layer = ggplot(aes(x = Longitude, y = Latitude),
data = SHA_1214_Stop_GPS), extent = "panel")
SHA_MAP_zoom12 + stat_density2d(aes(x = Longitude, y = Latitude, fill = ..level..,
alpha = ..level..), size = 2, bins = 5, data = SHA_1214_Stop_GPS, geom = "polygon") +
scale_alpha(range = c(0.4, 0.75), guide = FALSE) + scale_fill_gradient(limits = c(0,
200))
## Warning: Removed 1105 rows containing non-finite values (stat_density2d).