I am trying get a full page plot of a world map on a A4 landscape PDF. 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 not 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 odd but works, and is mentioned in the docs. It gives me a world map that fills the page left-right, but not top-bottom because it is keeping the aspect ratio.
You could extract coordinates:
coord <- map.poly(database="world", regions=".", exact=FALSE,
xlim=NULL, ylim=NULL, boundary=TRUE, interior=TRUE, fill=FALSE,
as.polygon=TRUE)
and then plot whatever you want with coord$x and coord$y.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With