控制坐标轴中刻度的个数,方向,刻度的标注,以及刻度的标注用到plot()中的xaxt,yaxt和axis低绘图参数等。这里面就不贴图了,自己用R界面试试就出来了。
1.R自动刻度
>x=seq(1,10)
>y=x
>plot(x,y)
2.控制不显示刻度
>plot(x,y,xaxt=”n”,yaxt=”n”)
3.自定义显示刻度个数以及位置axis
>plot(x,y,xaxt=”n”,yaxt=”n”)
> axis(1,at=seq(1,10,0.5))
> axis(2,at=seq(1,10))
4.控制刻度上的标注:
R中默认的标注是数字,但是过不想要数字呢,用到axis中的label
> plot(x,y,xaxt="n",yaxt="n")
> ILoveLittree=c("I","L","o","v","e","L","i","t","t","r","e","e","!","!","!","!","!","!","!")
> axis(1,at=seq(1,10,0.5),label=ILoveLittree)
> axis(2,at=seq(1,10))
参考资料:http://www.newsmth.net/nForum/#!article/Statistics/9567?au=Bighuyo
转载自:http://blog.sina.com.cn/s/blog_6babbcb801019njz.html