envinmrRasterPlot: modify spplot objects

View source: R/envinmrRasterPlot.R

envinmrRasterPlotR Documentation

modify spplot objects

Description

this function updates existing spplot objects so that i) the axes are drawn at all four sites (as these usually represent coordinates) and ii) the colorkey is plotted on top of the graph so that the main = ... argument can be used to describe the colorkey.

Usage

envinmrRasterPlot(
  spplot.obj,
  rot = 90,
  col,
  key.cex = 1,
  width = 1,
  height = 0.75,
  ...
)

Arguments

spplot.obj

the spplot object to be modified

rot

Rotation angle of the y-axis tick labels. Defaults to 90 degrees.

col

Color vector. If not specified, color information will automatically be extracted from spplot.obj.

key.cex

size of the colorkey labels.

width

Key width.

height

Key height.

...

additional arguments passed to update.trellis

Value

a single lattice plot object

Author(s)

Tim Appelhans

See Also

update.trellis, spplot

Examples

library(RColorBrewer)

rst <- raster::raster(volcano)

p1 <- spplot(rst)
p1

p2 <- envinmrRasterPlot(p1, col.regions = envinmrPalette(100))
p2

## change the colors as you like
p3 <- envinmrRasterPlot(p2, 
                        col.regions = 
                        colorRampPalette(brewer.pal(9, "YlGnBu"))(100))
p3

Orcs::latticeCombineGrid(list(p2, p1, p3))


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.