plot.triang.list: Plot Delaunay triangles

View source: R/plot.triang.list.R

plot.triang.listR Documentation

Plot Delaunay triangles

Description

A method for plot. Plots the triangles of a Delaunay triangulation of a set of points in the plane.

Usage

## S3 method for class 'triang.list'
plot(x, showrect = FALSE, add = FALSE,
              xlab = "x", ylab = "y", main = "", asp = 1,
              rectcol="black", ...)

Arguments

x

An object of class “triang.list” as produced by triang.list().

showrect

Logical scalar; show the enclosing rectangle rw (see deldir()) be plotted?

add

Logical scalar; should the plot of the triangles be added to an existing plot?

xlab

Label for the x-axis.

ylab

Label for the y-axis.

main

A title for the plot (used only if add is FALSE).

asp

The aspect ratio of the plot; integer scalar or NA. Set this argument equal to NA to allow the data to determine the aspect ratio and hence to make the plot occupy the complete plotting region in both x and y directions. This is inadvisable; see the Warnings.

rectcol

Text string or integer specifying the colour in which the enclosing rectangle should be plotted. Ignored unless showrect is TRUE.

...

Arguments passed to polygon() which does the actual plotting of the triangles.

Value

None. This function has the side effect of producing (or adding to) a plot.

Warnings

Users are strongly advised not to set the value of asp (unless they really know what they are doing) but rather to leave asp equal to its default value of 1. Any other value distorts the tesselation and destroys the perpendicular appearance of lines which are indeed perpendicular. (And conversely can cause lines which are not perpendicular to appear as if they are.)

The argument asp was added at the request of Zubin Dowlaty (who presumably knows what he is doing!).

Author(s)

\rolf

See Also

deldir(), plot.triang.list(), tile.list(), plot.tile.list()

Examples

set.seed(42)
x <- runif(20)
y <- runif(20)
d <- deldir(x,y)
ttt <- triang.list(d)
plot(ttt,border="red",showrect=TRUE,rectcol="green")
sss <- tile.list(d)
plot(sss)
plot(ttt,add=TRUE,border="blue",showrect=TRUE,rectcol="red")

deldir documentation built on May 29, 2024, 7:58 a.m.