1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R言語でグラフの保存(pngとウィンドウズメタファイル)

Posted at

いつもグラフをコピー&ペーストで保存していたのですが、面倒なので直接ファイルとして保存する方法を調べました。

04_Output_Graph.R
#Get sample data
x<-iris$Sepal.Length
y<-iris$Sepal.Width

#-------Output Png file------------------
png("04_output.png") #Open device
plot(x,y) 
dev.off() #Close device

#-------Output windows meta file (vector image) ------------------
win.metafile("04_output.wmf")
plot(x,y) 
dev.off() #Close device

結果(png) : ウィンドウズメタファイルはQiitaに投稿できないみたいです。
04_output.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?