[R-sig-eco] Fwd: Contour colour gradations and overplotting problems

Margaret Donald merricks.merricks at gmail.com
Thu May 5 12:07:32 CEST 2016


---------- Forwarded message ----------
From: Margaret Donald <merricks.merricks at gmail.com>
Date: 5 May 2016 at 17:52
Subject: Contour colour gradations and overplotting problems
To: r-sig-ecology at r-project.org


Dear List,

I have used the package nlme to interpolate a set of values which I then
want to show as a contour graph.

# Plot the image: First method:
#-------------------------------------
zmesh <- matrix(zmesh,ng,ng)
image(xgrid,ygrid,zmesh,bty="l",xlab="Easting",ylab="Northing",
      col=terrain.colors(1000),  xlim=c(xmin, xmax), ylim=c(ymin, ymax),
      main="Bivariate smooth of number of native species/.01 ha")
points(x,y,col="red",cex=0.7)
lines(Jboundary[,1],Jboundary[,2],col="blue",lwd=2)

This method overplots the points and lines correctly, but I don't get a
scale bar.



# Plot the image: Second method:
#-------------------------------------
filled.contour(xgrid,ygrid,zmesh,col=terrain.colors(25),
       xlab="Easting",ylab="Northing",
       xlim=c(xmin, xmax), ylim=c(ymin, ymax))
title ("Number of native species/.01 ha")
points(x,y,col="red",cex=0.7)
lines(Jboundary[,1],Jboundary[,2],col="blue",lwd=2)

This method overplots the points and lines incorrectly.  I DO get a scale
bar.

However, I would like to reverse the colour scale so that dark green
represents my highest values and the burnt-out pale pink represents the
lowest value.  (I would like this because the high values represent well
treed areas and the low values often represent cleared ground...)

I am hoping someone knows a set of functions which graph my coloured
contour plot correctly, with the desired colours and which correctly
overplots the lines and points on the scale of the contour plot.


Regards,

Margaret Donald

-- 
Margaret Donald BA (Hon), M. App Stat, Ph.D, AStat
Statistician, Anne Clements & Associates



-- 
Margaret Donald BA (Hon), M. App Stat, Ph.D, AStat
Statistician, Anne Clements & Associates

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list