Skip to content
Prev 5362 / 7420 Next

Fixing vertical and horizontal axes in R

Thanks, Shane, but that is precisely my problem. The final graph will not
be the default windows size and I want to
    a) nominate the overall height & width, and
    b) enforce the equal scales on the x and y axes.

My code currently looks like this:

# Generate image plot 2:
#-----------------------
fn <- "SpeciesRateLevels11F.jpg"
jpeg(fn, width=600, height=700)
zmeshR <- matrix(zmeshR,ng,ng)
image(xgrid,ygrid,zmeshR,bty="l",xlab="Easting",ylab="Northing",
      col=zz.colors,  xlim=c(xx1, xx2), ylim=c(yy1, yy2),
      main="Estimated number of native species /.01 ha")
points(x,y,col="red",cex=0.7)
lines(Jboundary[,1],Jboundary[,2],col="black",lwd=2)

b <- contourLines(xgrid,ygrid ,
             zmeshR, nlevels=11,
             levels = c(2, 4, 6, 8,10,12,14,16,18,20,22))
for (i in 1:11){
    lines(b[[i]], col="black", lwd=1)
}

Cheers,
Margaret Donald
On 12 May 2016 at 14:02, Shane Baylis <shane.m.baylis at gmail.com> wrote: