2012-05-25 75 views
3

我想在A4風景PDF上獲取世界地圖的整頁圖。當我用下面的打印整頁世界地圖圖時的空白區域

pdf("temp.pdf", paper="a4r") 
#par(mar=rep(0,4)) 
map("world", mar = rep(0,4)) 
dev.off() 

我得到

enter image description here

我似乎無法得到情節以填充頁面。有小費嗎?

回答

7

嘗試:

pdf("temp.pdf", paper="a4r",width=0,height=0) 
map("world") 
dev.off() 

這看起來很奇怪,但工程,並在文檔中提到。它給了我一張左右填充頁面的世界地圖,但不是由於它保持縱橫比而不是上下。

+0

很好。非常感謝。 – gjabel

1

您可以提取座標:任何你想要的coord$xcoord$y

coord <- map.poly(database="world", regions=".", exact=FALSE, 
     xlim=NULL, ylim=NULL, boundary=TRUE, interior=TRUE, fill=FALSE, 
     as.polygon=TRUE) 

,然後陰謀。