1.画底纹格子 grid()函数
> plot(rnorm(100)) > grid() #画底纹格子 > grid(nx=NA, ny=8, #画水平底纹,横坐标无分隔,纵坐标分为8份 + lwd=1,lty=2,col="blue")
2.画垂直线和水平线 abline()函数
> plot(rnorm(100)) > abline(v=20) #画垂直线 > abline(h=1,col="red",lty=2) #画水平线
3.画Sparkline
>rain <- read.csv("cityrain.csv")
>par(mfrow=c(4,1),mar=c(5,7,4,2),omi=c(0.2,2,0.2,2)) #将画板分成4行1列 # mar,omi 图形边界距离的确定
>for(i in 2:5)
+{
+plot(rain[,i],
+ann=FALSE, # ann图形注释
+axes=FALSE, # axes坐标轴的有无
+type="l", col="gray",lwd=2)
+mtext(side=2,at=mean(rain[,i]),names(rain[i]), las=2,col="black")
+mtext(side=4,at=mean(rain[,i]),mean(rain[i]), las=2,col="black")
+points(which.min(rain[,i]),min(rain[,i]),pch=19,col="blue")
+points(which.max(rain[,i]),max(rain[,i]),pch=19,col="red")
+}