plotting points on a world map using ggmap?

1,248 views
Skip to first unread message

Sarah Supp

unread,
Oct 14, 2013, 12:43:00 PM10/14/13
to ggp...@googlegroups.com
I'm new to using ggplot2 and ggmap, but I have been impressed with how quickly and easily I can make good-looking maps across many different scales using ggmap! For my current project, I need to plot points that occur across the globe on a map with a black and white terrain background. I am having trouble getting any background map to show when I specify zoom = 1, or anything <3. In this case, I just get a scatterplot of the points on a blank background. Is this not a current functionality of ggmap? Some posts I found on Stack Overflow suggest it may not be possible to zoom out this far. If not, are there plans to develop the package to make it possible in the future?

Sarah

David Kahle

unread,
Oct 15, 2013, 9:23:39 AM10/15/13
to Sarah Supp, ggp...@googlegroups.com
This works for me on a dev version of ggmap:

bbox <- c(left = -170bottom = -60right = 170, top 80)
ggmap(get_stamenmap(bboxzoom = 3maptype="toner"), extent = "device")

Stamen doesn't make it's terrain for the entire world : http://tile.stamen.com/terrain/#4/19.00/-456.40
but it does most others, e.g. the toner : http://tile.stamen.com/toner/#2/19.0/-456.4

("toner-lite" in the dev version is probably better for you.)

For the dev version, do the following (and restart R afterwards)

install.packages("devtools")
library(devtools)
install_github("ggmap","dkahle")


Cheers
david.

On Oct 14, 2013, at 11:43 AM, Sarah Supp wrote:

I'm new to using ggplot2 and ggmap, but I have been impressed with how quickly and easily I can make good-looking maps across many different scales using ggmap! For my current project, I need to plot points that occur across the globe on a map with a black and white terrain background. I am having trouble getting any background map to show when I specify zoom = 1, or anything <3. In this case, I just get a scatterplot of the points on a blank background. Is this not a current functionality of ggmap? Some posts I found on Stack Overflow suggest it may not be possible to zoom out this far. If not, are there plans to develop the package to make it possible in the future?

Sarah


--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
 
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-------------------------------------------------------------
-------------------------------------------------------------

David J. Kahle, Ph.D.
Assistant Professor of Statistical Science
Department of Statistical Science
Baylor University
One Bear Place #97140
Waco, Texas 76798




Reply all
Reply to author
Forward
0 new messages