sl.plot.elem: Plot Grid Elements

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/sl.plot.elem.R

Description

Plot the elements of a triangular grid. The elements can be filled and/or their edges can be drawn. A special feature is colouring edges according to their length (resolution).

Usage

1
sl.plot.elem(plot.init.res, lon, lat, elem, border = TRUE, col.border = "black", length.corr = "none", border.colbar = sl.colbar.redgreyblue_256, border.colbar.breaks = NA, border.colbar.breaks.log = FALSE, fill = TRUE, col.fill = "grey", cell_area = NA, lwd = 1, lty = 1)

Arguments

plot.init.res

a spheRlab plot specifics list as returned by sl.plot.init (or a variant thereof).

lon

a vector of length N specifying the longitudes of the grid nodes.

lat

a vector of length N specifying the latitudes of the grid nodes.

elem

an Nex3 matrix providing the vertex indices of each triangular element spanned by the nodes in num. Note that Ne ~= 2xN.

border

a logical value indicating whether or not to plot element edges.

col.border

the colour of the element edges.

length.corr

one of "none" and "triag2quad", indicating whether or not to apply a correction to translate edge lengths to effective resolution of a regular grid (by multiplication with sqrt(cos(pi/6)); only used if col.border="length"). Default is length.corr="none".

border.colbar

a spheRlab colourbar (as returned by sl.colbar) of length Nc to be used for element edges (only used if col.border="length").

border.colbar.breaks

a numeric vector of length Nc-1 specifying the breaks between colours (only used if col.border="length").

border.colbar.breaks.log

a logical value indicating whether colourbar breaks are to be placed logarithmically (only used if col.border="length" and col.border.breaks is not specified).

fill

a logical value indicating whether or not to fill elements.

col.fill

the fill colour (only used if fill=TRUE).

cell_area

NOT YET USED. Could be specified to fill with colours according to cell areas. However, this could also be done with sl.plot.field?

lwd

the line width of the borders (edges).

lty

the line type of the borders (edges).

Details

For element filling (fill=TRUE), sl.plot.polygon is used. For edges (border=TRUE), sl.plot.lines is used; with col.border="length", sl.gc.dist and sl.num2colbar are used.

Value

If a colourbar is used, it will be returned for further usage (e.g., for plotting of the colourbar).

Note

Maybe functionality should be added to fill elements with colours according to resolution (not just edges as already implemented); however, this could also be done with sl.plot.field?

Author(s)

Helge Goessling

See Also

sl.plot.field, sl.plot.field.elem, sl.plot.landsea

Examples

1
## To be provided ...

helgegoessling/spheRlab documentation built on Sept. 29, 2017, 6:36 a.m.