Skip to content
Prev 22906 / 398502 Next

plot and bg

If it helps you

x<-runif(100,10,20)
y<-2*x+rnorm(length(x),0,1)
xticks<-pretty(x)
yticks<-pretty(y)

par(bg="gray")
coord <- par("usr")
plot(x, type="n",axes=FALSE,ann=FALSE,xlim=range(xticks),ylim=range(yticks))
rect(coord[1],coord[3],coord [2],coord [4],col="yellow",border="navy")

points(x,y,pch=20,cex=1.5,col="red")
axis(1, col.axis="navy")
axis(2, col.axis="navy")

Best, isaia
Olivier Martin wrote: