Creating high resolution map using ggmap

Hello,
I would like to plot some sampling sites on a base map in R using ggmap.
I read a turtorial and adjusted my R code. The code allows me to plot my points on a map.
However, the map resolution is very low (very blurry) and I do not know why. Also I cannot
change the maptype (e.g. change maptype="terrain-background" to "terrain"). The map always looks the same (see picture)
I updated my R-version to the newest version and successfully installed/load all the necessary packages.

Processing: map1.tiff...

Can anyone help me to create a high-res. map and change the map type?
Thanks a lot

Below is my code and my "raw data" (as dput())

My data:
dput(locs)

structure(list(Type = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Diploid", "Triploid"
), class = c("ordered", "factor")), Geno = c("Dip1", "Dip2", 
"Dip3", "Dip4", "Dip5", "Dip6", "Dip7", "Dip8", "Trp1", "Trp2", 
"Trp3", "Trp4", "Trp5", "Trp6", "Trp7", "Trp8"), lon_dec = c(-89.62312503, 
-89.44206389, -89.542802, -89.408575, -89.46752, -89.460255, 
-89.471613, -89.425002, -89.574944, -89.366358, -89.545572, -89.408627, 
-89.467386, -89.447651, -89.473309, -89.424987), lat_dec = c(43.55215705, 
43.02782603, 43.536443, 43.469427, 43.657095, 43.64986, 43.650164, 
43.657844, 43.539666, 43.288958, 43.537272, 43.470119, 43.656855, 
43.646961, 43.649785, 43.661481)), row.names = c(NA, -16L), class = "data.frame")

My code

require(ggplot2)
require(ggmap)
require(maps)
require(mapproj)
require(mapdata)
require(rgeos)#
require(maptools)
require(sp)
require(raster)#
require(rgdal)#
require(dismo)#

locs
locs$Type<-ordered(locs$Type,levels=c("Diploid", "Triploid"))

range(locs$lat_dec)
range(locs$lon_dec)

#add some extra 
base = get_map(location=c(-90,42.7,-87.5,44),source = "stamen", zoom=7,maptype="terrain-background")
map1 = ggmap(base)
map1


map1+geom_point(data=locs, aes(x=lon_dec, y=lat_dec, fill=Type, shape=Type), color="white", cex=2) + # plot the points
  scale_fill_manual(values = c("red", "#59A044"), labels=c("Diploid", "Triploid"), name=NULL) +
  scale_shape_manual(values = c(23,24), labels=c("Diploid", "Triploid"), name=NULL) + # define shape/color scales
  labs(x="Latitude", y="Longitude", title="Collection sites") + # label the axes
  theme_bw() + theme(legend.position="bottom", axis.text = element_text(size = rel(0.75)), legend.key = element_rect(colour = "white"), axis.text.x = element_text(angle=45, vjust=0.5)) # tweak the plot's appearance and legend positio

dput(locs)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.