Skip to content
Prev 14104 / 29559 Next

Reducing the size of the R-produced maps while saving

Roger Bivand wrote:

            
Couldn?t (part of) the problem also be that the map object contains much 
more information than what is displayed? I have experienced this when 
plotting small parts of large maps using xlim and ylim. The resulting map 
displayed on screen and saved in a vector format (e.g., PDF) would show just 
the few countries within the xlim and ylim boundaries, but the file would 
actually contain (for example) the entire Eurasia continent (this could be 
seen by opening the file in Inkscape and moving map outlines or changing the 
boundary box).

The best solution is to crop the map object before saving. Note that for 
detailed map objects, this can be a *very* slow process. And the polygons 
are actually closed, so you will see black horizontal or vertical lines in 
the margin. I guess you could could crop the map to slightly outside the 
xlim and ylim boundaries before saving it to avoid this last problem.