3

Using R: I'm looking to add a world map to my existing plot but I am having issues. My existing plot shows sea surface temperatures of the pacific ocean so I need to essentially shift the world map from the traditional Atlantic view to a pacific view.

When I add the map, it is not aligned with my existing plot of world-wide Sea Surface Temperatures. I need the landmass to align with the white spaces on the map. (you can see the map by viewing the link below)

I've been using map() from the library maps. The lat-long that my existing plot is based on are decimal degrees. I have tried xlim and ylim arguments in map()- they haven't seemed to do anything. I haven't played around with coordinate systems though- mainly because I don't know what to try. Any suggestions? My code is at the link below.

http://rpubs.com/redi1102/9930

The section I specifically am asking about is this:

image.plot(xlong,ylat,zmat,ylim=range(-60,80))
contour(xlong,ylat,(zmat),ylim=range(-60,80),add=TRUE,nlev=6,lwd=2)
world(xlim=c(-150,150), ylim=c(-60,80),add=T)

Thankyou!

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
user2905307
  • 77
  • 1
  • 1
  • 6
  • According to the documentation, `world` takes arguments for the function `map`, which takes an `orientation` argument. I suspect the answer lies there, but I can't seem to give that argument any values without `world` throwing an error. – Scott Ritchie Oct 22 '13 at 03:36
  • I have looked at that argument but like you have only gotten errors. I'll play around with it more though. Thanks for your input. – user2905307 Oct 22 '13 at 04:09
  • 3
    [Here](http://stackoverflow.com/questions/5353184/fixing-maps-library-data-for-pacific-centred-0-360-longitude-display) and [here](http://stackoverflow.com/questions/10620862/use-different-center-than-the-prime-meridian-in-plotting-a-world-map/10749877#10749877) and [here](http://stackoverflow.com/questions/11201997/world-map-with-ggmap) are some answers that might help. – Josh O'Brien Oct 22 '13 at 04:30

0 Answers0