plot.field: Plot esd objects

View source: R/plot.R

plot.fieldR Documentation

Plot esd objects

Description

These plot functions are S3 methods for esd objects, based on plot.

Usage

## S3 method for class 'field'
plot(
  x,
  ...,
  is = NULL,
  it = NULL,
  FUN = "mean",
  map.type = "rectangle",
  verbose = FALSE
)

Arguments

x

the object to be plotted

...

additional arguments

is

For subsetting in space - See subset. Can also be a station value and if provided, the plotting will involve an interpolation to the same coordinates as defined by is.

it

For subsetting in time - See subset.

map.type

'points' to show stations on map, 'rectangle' to show area

verbose

a boolean; if TRUE print information about progress

plot.type

"single"

new

if TRUE plot in new window

type

type of plot: 'l' = line, 'p' = point, 'b' = both

pch

type of marker

main

main title

xlab

label of x-axis

ylab

label of y-axis

errorbar

if TRUE show errorbar

legend.show

if TRUE show legendp

map.show

show map of stations

map.insert

if TRUE show map as insert, else show map in new window

ip

Which EOF/CCA pattern (mode) to plot

cex

magnification factor, see par

cex.axis

see par

cex.lab

see par

cex.main

see par

mar

see par

fig

coordinates of figure region, see par

alpha

transparency factor for main plot

alpha.map

transparency factor for map

col

Colour see par

lwd

width of line

xlim

range of x-axis

ylim

range of y-axis

what

Indicate what to plot. For plot.eof, c('pc', 'eof', 'var') is the default setting which means that the plot will include the principle components, EOF patterns and explained variance. 'field' expands eof to field before plotting

colbar

a list, see colbar

Value

None

Examples


# Example: use aggregate to compute annual mean temperature for Svalbard:
data(Svalbard)
y <- aggregate(Svalbard, by=year(Svalbard), FUN='mean', na.rm = FALSE) 
plot(y, new=FALSE)

# Example with downscaling:
lon <- c(-12,37)
lat <- c(52,72)
t2m <- t2m.DNMI(lon=lon,lat=lat)
data(Oslo)
ds <- DS(Oslo,t2m)

# Plot the results for January month
# plot(subset(ds,it='Jan'))

# Plot the residuals:
residual <- as.residual(ds)
obs <- as.anomaly(as.calibrationdata(ds))

plot.zoo(obs[,1], lwd=2, new=FALSE)
lines(residual, col="red")

print("Global climate model simulation NorESM")
T2m <- t2m.NorESM.M(lon=lon,lat=lat)

# Plot the global mean of the field:
plot(T2m, new=FALSE)
# Plot area mean of a sub region
plot(T2m,is=list(lon=c(0,10),lat=c(60,70)), new=FALSE)

# Plot interpolated results corresponding to ferder
data(ferder)
plot(T2m, is=ferder, new=FALSE)

# Plot Hovmuller diagram: Not working ...
## plot(T2m,is=list(lon=0)) 

print("Extract a subset - the January month")
x <- subset(t2m,it="jan")
X <- subset(T2m,it="jan")

print("Combine the fields for computing common EOFs:")
XX <- combine(x,X)

print("Compute common EOFs")
eofxx <- EOF(XX)
plot(eofxx, new=FALSE)

print("Downscale the January mean temperature") 
ds.jan <- DS(Oslo,eofxx)
plot(ds.jan, new=FALSE)


metno/esd documentation built on April 29, 2024, 3:34 p.m.