|
想要划一个带有须轴线和密度线的直方图,求问一下代码是怎么回事?
> hist(mtcars$mpg,freq=FALSE,breaks=12,col="red",xlab="miles per gallon",main="curve")
> rug(jitter(mtcars$mpg))
错误于axis(side = side, at = at, labels = labels, ...) :
plot.new has not been called yet
此外: 警告信息:
In rug(jitter(mtcars$mpg)) : 有些值不能被修整
> lines(density(mtcars$mpg),col="blue")
错误于plot.xy(xy.coords(x, y), type = type, ...) :
plot.new has not been called yet
|
|