2013-08-23 17 views
2

我可以用做R中的空情節:R - 如何繪製沒有高度的空圖?

plot.new() 

創造具有默認寬度和高度的空白情節。

我想創建一個最小高度的空圖。我試過png('z.png', height=1),但那讓我:

> png('x.png', height=1) 
> plot.new() 
Error in plot.new() : figure margins too large 

我該如何創建這樣的情節?我想我也必須調整利潤率。

+1

您可以加入一些細節說明你正在嘗試與此有關呢?目前形式的問題讓我感到困惑,爲什麼有人會希望這個工作。 – Dinre

+0

情節直接進入一個網站,我不希望它在出現錯誤時佔用任何空間。我正在管理另一個級別的錯誤(make)。 – Penz

回答

3

嗯......我不知道你爲什麼會想這樣做,但這裏有雲:

# Make a png file 
png('x.png', height=1) 

# Change the margins of the plot to 0 on each side 
par(mar=rep(0,4)) 

# Make an empty plot 
plot.new() 

# Close the connection to the png file 
dev.off() 
+0

完美! 我之前嘗試過類似的東西,我的錯誤是在png()之前調用par()。 – Penz