Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to project this map in robinson projection:

world <- map_data("world")
ggplot() + geom_path(data = world, 
                              aes(long, lat, group = group))

enter image description here

And I would like to change the projection to "Robinson" (following advice from answer to my previous question: What projection does the global climate region map from Wikipedia use?

I had a hard time finding a default implementation of this projection, I worked out the following for using the proj4 library:

robinson <- project(cbind(world$long, world$lat), 
                    proj = "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")

I have tried a number of approaches, including:

# using
get_map("world", projection = mapprojection(robinson))
# using ggplot2::coord_map
coord_map(projection = robinson)
# and sp::coordinates:
coordinates(world) <- ~ lat + long
gridded(world) <- TRUE # returns error
proj4string(world) <- CRS(robinson)

but none of these work. Is it a typo, or I missing something fundamental about this method?

share|improve this question

It might be tricky to handle Robinson from within ggplot2.

AFAIK ggplot2 coord_map solution you explored will use projection information as defined in mapproject package. There are few available there but unfortunately Robinson is not one of them and I'm not sure if you can add your own.

Also - the world data you are using (from ggmap package I presume) is already a data frame class. So you will not be able to reproject it easily (?).

My suggestion would be start from scratch using shape file and handle geographical data before passing them to ggplot2. My cursory solution using Natural Earth data would follow this steps:


# get data
download.file(url="", "", "auto")

# read shape file using rgdal library
ogrInfo(".", "ne_110m_admin_0_countries")
world <- readOGR(".", "ne_110m_admin_0_countries")
plot(world, col = "grey")  

readOGR uses information about the projection from prj file and summary now tells me now that world is now

Object of class SpatialPolygonsDataFrame
   min       max
x -180 180.00000
y  -90  83.64513
Is projected: FALSE 
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]

And looks like that:

enter image description here

Let's transform to Robinson:

worldRobinson <- spTransform(world, CRS("+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"))
plot(worldRobinson, col = "grey")  

Summary is now:

Object of class SpatialPolygonsDataFrame
        min      max
x -16810131 16810131
y  -8625154  8343004
Is projected: TRUE 
proj4string :
[+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs +towgs84=0,0,0]

And it looks like that:

enter image description here

From here you should be able to continue with ggplot (fortify might be needed).

share|improve this answer

You can now do this directly with the ggalt package:


wrld <- map_data("world")

gg <- ggplot()
gg <- gg + geom_map(data=wrld, map=wrld,
                    aes(x=long, y=lat, map_id=region),
                    color="#2b2b2b", size=0.15, fill=NA)
gg <- gg + coord_proj("+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
gg <- gg + theme_map()

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.