Reputation: 2666
I want to create a map of where my study sites are. All sites are in Northern temperate latitudes. To do this, I first load a world map, then set the y axis to only include northern temperate latitudes (between 23.5 and 66.5 degrees longitude).
#build map
world <- map_data("world") # we already did this, but we can do it again
map <- ggplot() + geom_polygon(data = world, aes(x=long, y = lat, group = group))
map <- map + coord_map(ylim = c(23.5, 66.5))
map
However, this mixes things up at the top of the map, and also places a strangle black line just north of 50 degrees latitude. How can I fix this?
Upvotes: 5
Views: 175
Reputation: 78792
You can slice it and use a real projection as well:
library(ggalt)
library(ggplot2)
world <- map_data("world")
ggplot() +
geom_cartogram(
data = world, map = world,
aes(x=long, y = lat, group = group, map_id=region)
) +
coord_proj("+proj=wintri", ylim = c(23.5, 66.5))
Upvotes: 4