This is a method for plot.
# S3 method for deldir
plot(x,add=FALSE,wlines=c('both','triang','tess'),
wpoints=c('both','real','dummy','none'),
number=FALSE,cex=1,nex=1,col=NULL,lty=NULL,
pch=NULL,xlim=NULL,ylim=NULL,axes=FALSE,
xlab=if(axes) 'x' else '',ylab=if(axes) 'y' else'',
showrect=FALSE,...)
An object of class "deldir" as constructed by the function deldir.
logical argument; should the plot be added to an existing plot?
"which lines?". I.e. should the Delaunay triangulation be plotted (wlines='triang'), should the Dirichlet tessellation be plotted (wlines='tess'), or should both be plotted (wlines='both', the default) ?
"Which points to plot?". I.e. should the real points be plotted (wpoints='real'), should the dummy points be plotted (wpoints='dummy'), should both be plotted (wpoints='both', the default) or should no points be plotted (wpoints='none')?
Logical argument, defaulting to FALSE
; if TRUE
then the
points plotted will be labelled with their index numbers
(corresponding to the row numbers of the matrix "summary" in the
output of deldir).
The value of the character expansion argument cex to be used with the plotting symbols for plotting the points.
The value of the character expansion argument cex to be used by the
text function when numbering the points with their indices. Used only
if number=TRUE
.
The colour numbers for plotting the triangulation, the tesselation, the data points, the dummy points, and the point numbers, in that order; defaults to c(1,1,1,1,1). If fewer than five numbers are given, they are recycled. (If more than five numbers are given, the redundant ones are ignored.)
The line type numbers for plotting the triangulation and the tesselation, in that order; defaults to 1:2. If only one value is given it is repeated. (If more than two numbers are given, the redundant ones are ignored.)
The plotting symbols for plotting the data points and the dummy points, in that order; may be either integer or character; defaults to 1:2. If only one value is given it is repeated. (If more than two values are given, the redundant ones are ignored.)
The limits on the x-axis. Defaults to rw[1:2] where rw is the rectangular window specification returned by deldir().
The limits on the y-axis. Defaults to rw[3:4] where rw is the rectangular window specification returned by deldir().
Logical scalar. Should axes be drawn on the plot?
Label for the x-axis. Defaults to x
if axes
is
TRUE
and to the empty string if axes
is FALSE
.
Ignored if add=TRUE
.
Label for the y-axis. Defaults to y
if axes
is
TRUE
and to the empty string if axes
is FALSE
.
Ignored if add=TRUE
.
Logical scalar; show the enclosing rectangle rw
(see
deldir()
) be plotted?
Further plotting parameters to be passed to plot()
segments()
or points()
or text()
. Unlikely to
be used.
A plot of the points being triangulated is produced or added to an existing plot. As well, the edges of the Delaunay triangles and/or of the Dirichlet tiles are plotted. By default the triangles are plotted with solid lines (lty=1) and the tiles with dotted lines (lty=2).
The points in the set being triangulated are plotted with distinguishing symbols. By default the real points are plotted as circles (pch=1) and the dummy points are plotted as triangles (pch=2).
deldir()
# NOT RUN {
try <- deldir(x,y,list(ndx=2,ndy=2),c(0,10,0,10))
plot(try)
#
deldir(x,y,list(ndx=4,ndy=4),plot=TRUE,add=TRUE,wl='te',
col=c(1,1,2,3,4),num=TRUE)
# Plots the tesselation, but does not save the results.
try <- deldir(x,y,list(ndx=2,ndy=2),c(0,10,0,10),plot=TRUE,wl='tr',
wp='n')
# Plots the triangulation, but not the points, and saves the
# returned structure.
# }
Run the code above in your browser using DataCamp Workspace