rug
rug()函数 :给图添加rug representation。
· 一维的
· rug的方式是补充,仅仅包括落在图像区域内的x的值,丢失掉任何有限的值,将会被警告;而丢失任何非有限的值,则静静地丢失吧,没反应。
rug(x,ticksize=,side=,lwd=,col=,quiet=)
·ticksize:rug小标签的补充;
·quiet:logical indicating if there should be a warning about clipped values.
例1:
> plot(mtcars$mpg,type="b") > rug(mtcars$mpg,col="green") Warning message: In rug(mtcars$mpg, col = "green") : 有些值不能被修整 >
例2:
> plot(mtcars$mpg,type="b",col="red") > rug(mtcars$mpg,ticksize=.03,side=1,lwd=0.5,col="blue",quiet=getOption("warn")<0) Warning message: In rug(mtcars$mpg, ticksize = 0.03, side = 1, lwd = 0.5, col = "blue", : 有些值不能被修整 > rug(mtcars$mpg,ticksize=.3,side=2,lwd=0.5,col="green",quiet=getOption("warn")<0) > rug(mtcars$mpg,ticksize=.3,side=4,lwd=0.5,col="yellow",quiet=getOption("warn")<0)