r语言中,使用plot画图,需要画的图有点有线,那么type参数的设置为

Python022

r语言中,使用plot画图,需要画的图有点有线,那么type参数的设置为,第1张

type='b'

所有参赛:

"p" for points,

"l" for lines,

"b" for both,

"c" for the lines part alone of "b",

"o" for both ‘overplotted’,

"h" for ‘histogram’ like (or ‘high-density’) vertical lines,

"s" for stair steps,

"S" for other steps, see ‘Details’ below,

"n" for no plotting.

利用spline函数

比如

x<-rnorm(50,0,3) #利用正态分布产生50个随机数

sp<-spline(x) #进行平滑处理

plot(sp,type="l") #画出图像