I am trying to get a full section of the world map in PDF A4. When I use the following
pdf("temp.pdf", paper="a4r") #par(mar=rep(0,4)) map("world", mar = rep(0,4)) dev.off()
I get
I can't seem to get the plot to fill the page. Any tips?
Try:
pdf("temp.pdf", paper="a4r",width=0,height=0) map("world") dev.off()
which looks weird but works and is mentioned in the docs. This gives me a world map that fills the page left to right, but not top to bottom, because it maintains the aspect ratio.
You can extract the coordinates:
coord <- map.poly(database="world", regions=".", exact=FALSE, xlim=NULL, ylim=NULL, boundary=TRUE, interior=TRUE, fill=FALSE, as.polygon=TRUE)
and then sketch whatever you want with coord$xand coord$y.
coord$x
coord$y