[R] [fields:image.plot] subtitle under title (not image)?

Tom Roche Tom_Roche at pobox.com
Tue May 1 18:25:25 CEST 2012


summary: how to make image.plot print a subtitle between the title and
the image, rather than under the image?

details:

I've got a project

https://github.com/TomRoche/ioapi-hack-R

that illustrates the use of (et al) the R packages {ncdf4, fields, M3}
for processing and visualizing IOAPI data. The data being visualized
consists of a series of layers (mostly representing emissions from a
particular tuple of agricultural {cultivar, cultivation technique})
over a surface (in the upper midwest US). I'm currently plotting

https://github.com/downloads/TomRoche/ioapi-hack-R/compare.DN2.layers.pdf

each layer, and including some information about the layer in a title
and subtitle. The title is where I want it--above the image--but the
subtitle is printing below the image; I'd prefer it between the title
and the image. Can this be done? FWIW, the code that plots (in

https://github.com/TomRoche/ioapi-hack-R/blob/master/plotLayersForTimestep.r

) is like

  if (data to plot is not all NA) {
    # determine quantiles, then
    image.plot(plot.list, xlab="", ylab="", axes=F, col=colors(100),
      axis.args=list(at=quantiles, labels=quantiles.formatted),
      main=title, sub=subtitle)
    lines(map)
  } else {
    plot(0, type="n", axes=F, xlab="", ylab="",
      xlim=range(x.centers), ylim=range(y.centers),
      main=title, sub=subtitle)
    lines(map)
  } # end testing data

TIA, Tom Roche <Tom_Roche at pobox.com>



More information about the R-help mailing list