plot.eof: Plot esd objects

View source: R/plot.R

plot.eofR Documentation

Plot esd objects

Description

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

Usage

## S3 method for class 'eof'
plot(
  x,
  ...,
  new = FALSE,
  xlim = NULL,
  ylim = NULL,
  ip = 1,
  what = c("pc", "eof", "var"),
  colbar = list(pal = NULL, rev = FALSE, n = 10, alpha = 0.8, breaks = NULL, type = "p",
    cex = 2, show = TRUE, h = 0.6, v = 1, pos = 0.05),
  verbose = FALSE,
  is = NULL,
  it = NULL
)

Arguments

x

the object to be plotted

...

additional arguments

new

if TRUE plot in new window

xlim

range of x-axis

ylim

range of y-axis

ip

Which EOF/CCA pattern (mode) to plot

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

verbose

a boolean; if TRUE print information about progress

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.

plot.type

"single"

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.type

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

map.insert

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

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

add

if TRUE add plot to existing figure

alpha

transparency factor for main plot

alpha.map

transparency factor for map

col

Colour see par

lwd

width of line

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'), new=FALSE)

# 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,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.