[R-sig-Geo] Reducing the size of the R-produced maps while saving

Karl Ove Hufthammer karl at huftis.org
Fri Feb 3 23:35:23 CET 2012


fr. den 03. 02. 2012 klokka 23.09 (+0100) skreiv Roger Bivand:
> Using the more general 
> Rgshhs(), there is a small difference in size:
> 
> > library(maptools)
> > x=Rgshhs(system.file("share/gshhs_c.b", package= "maptools"), 
> + xlim=c(0,30), ylim=c(55,75), no.clip=TRUE)$SP
> Data are polygon data
> > pdf("gshhs_noclip.pdf")
> > plot(x, xlim=c(0,30), ylim=c(55,75))
> > dev.off() 

Yes, and there is a small difference in the amount of vector information
stored in the PDF. Try

library(maptools)
x=Rgshhs(system.file("share/gshhs_c.b", package= "maptools"), 
         xlim=c(0,50), ylim=c(55,75), no.clip=TRUE)$SP
pdf("gshhs_noclip.pdf")
plot(x, xlim=c(30,50), ylim=c(55,75))
dev.off()

If you import the PDF in Inkscape, select all objects and use the
ungroup command a couple of times, you can see *all* of Norway.
The difference is not as large as I remember, though, as the PDF 
doesn’t include all of Eurasia (it’s clipped to the media/page box).
This may be because of changes in R, or that the file format (EMF? WMF)
I used didn’t support proper clipping. I can’t test this right now, as
I’m not on a Windows system.

-- 
Karl Ove Hufthammer
http://huftis.org/
Jabber: karl at huftis.org



More information about the R-sig-Geo mailing list