2012-10-29 57 views
0

我想爲美國的不同州添加不同的顏色。 但是,當我連續運行所有我的map("state",."insert coloring condition"...)命令時,我沒有得到覆蓋圖,它只是更新了地圖,但沒有保持着色(如預期的那樣)。在繪製梯形圖時,您可以使用lines()points(),但它不適用於地圖。 那麼,我該怎麼做?用於繪製地圖的「等待」等價物

+0

does'> par(new = TRUE)'help? –

+1

「map」沒有'add'參數嗎? – joran

+0

@joran - 你是對的。這應該可能是答案。 –

回答

1

如果你讀了?map的文檔,你會發現有一個add說法:

logical flag that specifies whether to add to the current plot. 
If FALSE, a new plot is begun, and a new coordinate system is set up. 

應該做你的描述。

+0

添加完整示例:map(「state」); map(「state」,region = c(「new york」),fill = TRUE,col =「pink」,add = TRUE);' – thelatemail