2017-11-24 9 views
1

私はいくつかのプロットを持つコードを持っています。その中にはレイアウトやその他のものがあります。問題は、私がレイアウトを描画するとき、次のプロットは、それだけでなければならず、前のレイアウト配置に現れます。レイアウト後にプロットのレイアウト配置を停止するにはどうすればよいですか?Rstudioのレイアウト後に次のデバイスでプロットを描くにはどうすればいいですか?

layout(matrix(c(1,2,3,4), 2, 2)) 
plot(1:10) 
plot(10:100) 
plot(100:1000) 
plot(1000:10000) 


#Plots that I dont't want into a layout 

plot(1, main = "Example 1") 

plot(2, main = "Example 2") 

私は全体のコードを実行すると、私は、Rstudioウィンドウにレイアウトを期待して、2つの分割のプロットが、私は得る:

enter image description here

enter image description here

+2

は 'レイアウト(1) 'とそれをreest、または' PAR(mfrow = C(1,1))ことができ、 ''またはdev.off () ' – user20650

+0

重複:https://stackoverflow.com/questions/29079546/undo-layout-in-r – user20650

答えて

2

次の行を実行してプロットデバイスの設定をリセットすることができます。

par(mfrow=c(1, 1)) 

その後、指定したコードを実行すると、プロットはすべて1つのフレームになります。

plot(1, main = "Example 1") 

enter image description here

plot(2, main = "Example 2") 

enter image description here

関連する問題