plotField {clim.pact}R Documentation

plotField

Description

Produce 2D plots like maps and Hovmuller diagrams. A poor man's version of Ferret's http://ferret.wrc.noaa.gov/Ferret/ plot function. plot.field is a high level command that utilises mapField or grd.box.ts whenever appropriate.

Usage

plotField(x,lon=NULL,lat=NULL,tim=NULL,mon=NULL,val.rng=NULL,
                      col="black",col.coast="grey",lty=1,lwd=1,what="ano",
                      type="l",pch=26,my.col=NULL,add=FALSE,
                      main=NULL,sub=NULL,xlab=NULL,ylab=NULL,
                      xlim=NULL,ylim=NULL)

Arguments

x A field object.
lon Position for longitude. One of lon, lat, tim must be set.
lat Position for latitude.
tim Position for time as time index (1:length(tim).
mon Month to extract.
val.rng Valid range: interval used for colour scale.
col Contour line colour for levels.
col.coast Contour line colour for coast lines.
lty Contour line type.
lwd Contour line width.
what Choose between "ano" - anomaly; "abs" absolute; "cli" climatological.
type same as in plot(), only works for single time series.
pch same as in plot(), only works for single time series.
my.col colour palette (see link{rgb}).
add TRUE adds a time series to previous (see link{grd.box.ts}).
main Preset main title (see plot).
sub subtitle
xlab x label
ylab y label
xlim see plot
ylim see plot

Author(s)

R.E. Benestad

Examples

## Not run: 
skt <- retrieve.nc("skt.mon.mean.nc",x.rng=c(-90,50),y.rng=c(0,75))

# Maps of monthly mean skin temperatures:
plotField(skt,tim=1,val.rng=c(-20,20))
dev2bitmap("ncep.skt_194801.jpg",type="jpeg")

plotField(skt,tim=100,col="blue",col.coast="darkgreen",val.rng=c(-10,10))

# For adding extra points/contours:

    # From filled.contour in base
    mar.orig <- (par.orig <- par(c("mar","las","mfrow")))$mar
    on.exit(par(par.orig))

    w <- (3 + mar.orig[2]) * par('csi') * 2.54
    layout(matrix(c(2, 1), nc=2), widths=c(1, lcm(w)))
   
    par(las = 1)
    mar <- mar.orig
    mar[4] <- 1
    par(mar=mar)
# End of section affecting the window set up.

points(0,50,pch=21,col="red")
grid()
dev2bitmap("ncep.skt_195604.jpg",type="jpeg")

# A hovmuller diagram:
plotField(skt,lon=0,val.rng=c(-10,10))
dev2bitmap("ncep.skt_lontim.jpg",type="jpeg")

# A single time series:
plotField(skt,lon=-20,lat=50)

## End(Not run)

[Package clim.pact version 2.2-15 Index]