2

here is the code that produces the plot below:

filled.contour(x,y,z, col=colors2, levels=breakpoints, plot.axes={axis(1); axis(2); map(add=TRUE, interior=FALSE)} )

A sample can be created using:

z=matrix(rnorm(7008),nrow=96)
x=seq(-176.25,180, by=3.75)
y=seq(-90,90, by=2.5)
filled.contour(x,y,z, plot.axes={axis(1); axis(2); map(add=TRUE, interior=FALSE)} )

However I can't seem to figure out how to crop/move the projected world map (from the 'maps' package) 3.75 degrees on/to the right side so it fits properly. This is equivalent to adding one more row onto the base of my original data matrix (z), which I don't want to do as it gives an empty column at one end. I have tried 'orientation' but can't get it to work.

I'm sure this is simple! Many help in advance

enter image description here

Edward Armstrong
  • 329
  • 2
  • 3
  • 12
  • I would recommend not fudging things to make it "fit". What if the grid is wrong but the map is right? After fudge both will be wrong. What is the data source? Get that right first and the map will work. My guess is you have centre coords mapped to the corners of grid cells. Btw " projected" usually means "not longitude/latitude" so perhaps clarify? – mdsumner May 29 '14 at 21:03
  • Hi mdsumner, thanks for the response. The data source is the metoffice so Im certain thats right. However I have sorted it now because I missed the glaringly obvious. I added a new row to the bottom of the matrix replicating the first, as the globe is a sphere and thus loops round! Its funny how one misses the most obvious things! – Edward Armstrong May 30 '14 at 13:57

0 Answers0