[经济学]统计与模拟R
画图(箭头和线段) x=runif(12);y=rnorm(12);I=order(x,y);x=x[i];y=y[i];plot(x,y, main=arrows(.) and segments(.))## draw arrows from point to point : s=seq(length(x)-1)# one shorter than data arrows(x[s],y[s],x[s+1],y[s+1],col= 1:3) s=s[-length(s)];segments(x[s],y[s], x[s+2],y[s+2],col=pink) 第一部分画点,第二部分画箭头,第三部分画线段 postscript(“myfile.ps”)#保存图像到文件 plot(1:10)#画散点图,不会显示在图形窗口 dev.off()#关闭设备 画图(继续) plot(complex(arg=seq(-pi,pi,len=20)),main=Complex numbers, sub=circle) 画图(时间序列) x=runif(100);x=ts(x,start=1960+(3/12),frequency=12);options(digits=2);x plot(x,main=Time series) Jan Feb Mar Apr Ma
原创力文档

文档评论(0)