我正在尝试绘制一维图,在直线上绘制一些点。
plotpoints<-function(x1){
## Make y-value=0
x<-cbind(x1,0)
## Plotting without box or axis with dot, representing data points
plot(x,bty='n',xaxt='n',yaxt='n',ylab='',xlab='',pch=20,cex=1.5,
col="red",main="Non Parametric sample size 10")
axis(side=1,line = TRUE ,cex.axis=0.8,las=2) ## Using y-value as position
}
但是我只能在一定范围内获得直线,有时点会像这样显示在外面
####Proof 10 points the star should be in point 997
x1<-rlnorm(10,5.5,0.9)
plotpoints(x1)
第一个点在线外,如何获取线内的所有点??