deldir (version 0.2-3)

plot.triang.list: 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 triang.list
plot(x, showrect = FALSE, add = FALSE,
              xlab = "x", ylab = "y", main = "", asp = 1, ...)

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.

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

The user is strongly advised not to set the value of asp 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.

See Also

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

Examples

Run this code
# NOT RUN {
set.seed(42)
x <- runif(20)
y <- runif(20)
d <- deldir(x,y)
ttt <- triang.list(d)
plot(ttt,border="red",showrect=TRUE)
sss <- tile.list(d)
plot(sss)
plot(ttt,add=TRUE,border="blue")
# }

Run the code above in your browser using DataCamp Workspace