Test Code/R
[R] plot을 이미지로 저장
yaks101
2014. 1. 4. 11:33
스크립트 | 결과 |
# 데이터 생성 x<-seq(-3.5,3.5,length=100) y<-dnorm(x) # margin # bottom, left, top, right par(mar=c(3,3,3,1)) # 이미지 저장 정보 png("NormalDist.png", width=400, height=300, pointsize=13 ) # 표준 정규분포 곡선 plot( x, y, type="l", col="red", las=1, xlab="", ylab="" ) # Chart grid for(i in -3:3) { abline( v=i, col="blue", lty=3 ) } for(i in 0:4) { abline( h=i/10, col="blue", lty=3 ) } dev.off() |
|