[R-sig-Geo] how to plot Raster*? problems with raster::plot, fields::image.plot

Tom Roche Tom_Roche at pobox.com
Tue Oct 23 06:00:11 CEST 2012


Could I get one or more spatial-plotting experts to examine defective
output produced when I try to plot a RasterLayer? I believe I'm pretty
close to solving these problems, but am very much a beginner, and at
the limit of my competence in this domain. I've tried to do this with
both raster::plot

http://stackoverflow.com/questions/13005181/rasterplot-problems-unwanted-rotation-extents

and with fields::image.plot

http://stackoverflow.com/questions/13022919/r-problems-visualizing-a-raster-with-fieldsimage-plot

In either case, the defective output (in a single 4-page PDF

https://github.com/downloads/TomRoche/GEIA_to_netCDF/GEIA_N2O_oceanic_regrid.pdf

where pages 1-3 are from raster::plot, and page 4 is from
fields::image.plot) can be generated by

1 Cloning

git://github.com/TomRoche/GEIA_to_netCDF.git

  onto a box with bash and an appropriately-configured R (notably,
  with packages=fields, ncdf4, raster).

2 `cd` to the cloned git repo (probably `cd ./GEIA_to_netCDF`)

3 Converting the ASCII input to netCDF, and plotting that netCDF, by
  running `./GEIA_to_netCDF.sh`, which calls

https://github.com/TomRoche/GEIA_to_netCDF/blob/master/GEIA.to.netCDF.r

4 Regridding the netCDF, and plotting that regridded output, by
  running `./regrid_GEIA_netCDF.sh`, which calls

https://github.com/TomRoche/GEIA_to_netCDF/blob/master/regrid.global.to.AQMEII.r

In each case the image extents are not as desired, and there is a
rotation problem (either involving the entire image, or just the
relation between an added map and the regridded data).

Your assistance is appreciated, Tom Roche <Tom_Roche at pobox.com>



More information about the R-sig-Geo mailing list