问题
I already created a bubble plot using the following code:
library(ggplot2)
library(sp)
library(raster)
library(maps)
library(mapdata)
library(maptools)
library(gstat)
library(ggmap)
xy <- se_pp[,c("longitude_s", "latitude_s")]
nl <- getData('GADM', country="Netherlands", level=2) #raster data, format SpatialPolygonsDataFrame
# coercing the polygon outlines to a SpatialLines object
spl <- list("sp.lines", as(nl, "SpatialLines"))
SPDF <- SpatialPointsDataFrame(coords=xy, data=se_pp)
projection(SPDF)<- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
coordinates(SPDF)[1:5,] #retrieves spatial coordinates form the dataframe
bubble(SPDF, "Quantity", sp.layout=spl, main="Plaice Quantity (#/km2), end summer (Sand Engine)")
Now I get a map of the Dutch coast containing the bubble plot (via getData). Unfortunately this is a very simple map. I would like to have a satellite map of the same area, which shows more detail, to show my bubble plot. Does anyone know if this is possible? Thanks.
回答1:
I am not sure if you still check SO. But, I leave one approach for you. You can play with the values in zoom to identify the best zoom for your purpose. The CRAN manual of ggmap
offers you more examples. Please have a look.
map <- get_map(location = 'netherlands', zoom = 7,
source = 'google',
maptype = 'satellite')
ggmap(map)
来源:https://stackoverflow.com/questions/23427479/create-bubble-plot-in-r-using-satellite-map