I have used the following code to generate this plot:
x<-c(0.916, 0.815, 0.101, -0.029, -0.166, 0.949, 0.073 , -0.054, 1.006)
y<-c(3.91, 5.17, 1.08, 1.28, 1.01, 4.37, 3.97, 0.77, 4.52)
plot(x,y, ylim=c(0, 8), xlim=c(-0.4, 1.2), pch=19, cex=0.6, cex.axis=1, cex.lab=1, yaxs='i', xaxs='i', las=1, bty="l")
I want the x and y to intersect at 0, I have tried using axes=FALSE and trying with axis function but does not work. It would be great to help me with that, thanks!
This is the way I tried to do it:
plot(x,y, xlim=c(-0.5, 1.2), axes=FALSE, pch=19)
axis(1, pos=0)
axis(2, pos=0, at=0:8)
and here is the weird looking plot!
The trick needed to get the axis(2,...) call to construct a line that made it all the way to (0,0) was to add the ylim argument. Otherwise the plot area was not large enought to support the range of axis values that you asked for.