无法在绘制 ogives 的绘图中为 x 轴设置特定值

Can not set specific values for the x axis in a plot plotting ogives

我正在用两个不同的 ogives 做一个情节。情节很好,y 轴是正确的,但问题是 x 轴。 我希望 X 轴从 0 到 18.000 以 1000 为单位变化。但是它不起作用!!

出于某种原因,没有任何效果!!我做的每一个情节的 X 轴都会改变。我无法设置具体值!

有人知道这是怎么回事吗?真的很奇怪

points<-ogive.freq(h,col="red",ylab="Frecuencia Relativa Acumulada",main="localidad")
j<-graph.freq(NiñoOK,plot=FALSE)
puntos<-ogive.freq(j,col="blue")

plot(puntos,type="b",xaxt="n",pch=19,las=1,bty="l",col="blue",ylab="Frecuencia Relativa Acumulada")
lines(points,col="red",type="b",pch=19,bty="l")
axis(1, at = seq(0, 18000, by = 1000), las=1)

这个我也试过了,也没用

axis(1, at = seq(0, 14000, by = 2000),labels=c("0","2000","4000","6000"
                ,"8000","10000","12000","14000"), las=2)

我找到了解决办法! 您必须在 plot()

中添加 xlim=c(0,14000)
points<-ogive.freq(h,col="red",ylab="Frecuencia Relativa Acumulada",main="localidad")
j<-graph.freq(NiñoOK,plot=FALSE)
puntos<-ogive.freq(j,col="blue")

plot(puntos,type="b",xaxt="n",pch=19,las=1,bty="l",col="blue",ylab="Frecuencia Relativa Acumulada")
lines(points,col="red",type="b",pch=19,bty="l")
axis(1, at = seq(0, 18000, by = 1000), las=1)