Why does ggplot2 produce a map offset depending on xlim of coord_map?

83 Views Asked by At

Can someone explain, why ggplot produces an offset in the map? The only thing I change in the two codes for map A and B is xlim. I do not get why this error is produced neither to solve this issue if I need a map with the extent of map A. Thank you for your help and time.

offset produced with  code of map A

world <- rworldmap::getMap(resolution = "low")
fty_world <- ggplot2::fortify( world)

## map A with offset in the image
ggplot() +
    geom_polygon( data = fty_world,
                                aes( x = long,
                                     y = lat, 
                                         group = group), 
                                         fill = "white",  
                                         color = "grey50") +
    coord_map( xlim = c( -3, 14), 
               ylim = c( 43, 54))

## map B without offset
ggplot() +
    geom_polygon( data = fty_world,
                                aes( x = long,
                                     y = lat, 
                                         group = group), 
                                         fill = "white",  
                                         color = "grey50") +
    coord_map( xlim = c( -2, 14), 
               ylim = c( 43, 54))

0

There are 0 best solutions below