Add raster to ggmap base map: set alpha (transparency) and fill color to inset_raster() in ggplot2
问题 I want to plot a map with a raster overlaying a GoogleMaps base map in ggplot2. Therefore, I used get_map() and insert_raster() like this: library(ggplot2) library(ggmap) bm <- ggmap(get_map(location = "Bangkok", maptype = "hybrid")) bm + inset_raster(as.raster(r), xmin = r@extent[1], xmax = r@extent[2], ymin = r@extent[3], ymax = r@extent[4]) Is there any possibility to set a alpha and change the fill color? The result looks like this: 回答1: Even Faster without fortify : read the original