Description Usage Arguments Examples
This function allows plotting line plots and maps of NetCDF objects using the respective attributes.
1 2 3 4 5 6 7 | ## S3 method for class 'NetCDF'
plot(x, type = if (nrow(x) == 1) "ts" else "mean",
ti = 1:dim(x)[length(dim(x))], si = 1, levs = NULL, col = NULL,
na.col = NULL, pt.cex = NULL, symmetric = FALSE, cut = TRUE,
add = FALSE, xlab = "", ylab = "", xlim = NULL, ylim = NULL,
xaxs = "i", yaxs = "i", lty = seq(along = si), lwd = 3, nlevs = 12,
colramp = "redblue", seas = F, ...)
|
x |
input object of class NetCDF (max. 2-d) |
type |
of plot ('ts' for lines, 'mean' and 'trend' for maps) |
ti |
index of time step to be plotted (map only) |
si |
index of spatial grid to be plotted |
levs |
levels to be used for contouring |
col |
colours to be used for contouring or lines |
na.col |
colour to be used for missing values (spatial plot only) |
pt.cex |
expansion factor for points |
symmetric |
logical, should contouring be symmetric about zero |
cut |
logical, should contouring be cut to range of data |
add |
logical, should plot be added |
xlab,ylab |
axes labels |
xlim,ylim |
range of axes |
xaxs,yaxs |
type of axes |
lty |
line type for line plots |
lwd |
line width for line plots |
nlevs |
number of contour interval (input to |
colramp |
colour ramp to be used with colourramp function (default) |
seas |
logical, should seasons be plotted individually? |
... |
additional arguments passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | tas <- readNetCDF(system.file("extdata", "annual_CRUTEMv3_1961-90.nc", package="geoutils"), varname="temp")
## average over all time steps
plot(tas)
## also plot the trends
plot(tas, type='trend', sym=TRUE)
## plot the same with legend
layout(matrix(1:2, 2, 1), height=c(5, lcm(2.5)))
par(mar=c(2,2,1,1))
tmp <- plot(tas, type='trend', sym=TRUE, na.col='lightgrey')
## if pt.cex is not set, the default pt.cex will be displayed
map(add=T, interior=F)
plot_colourbar(tmp, units='K/a')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.