plot.ahull {alphahull} | R Documentation |
Plot the alpha-convex hull
Description
This function returns a plot of the α-convex hull. If desired, it also adds the Delaunay triangulation, Voronoi diagram and α-shape of the sample.
Usage
## S3 method for class 'ahull':
plot(x, add = FALSE, do.shape = FALSE,
wlines = c("none", "both", "del", "vor"), wpoints = TRUE,
number = FALSE, col = NULL, xlim = NULL,
ylim = NULL, lwd = NULL, ...)
Arguments
x |
Object of class "ahull" . |
add |
Logical, if TRUE add to a current plot. |
do.shape |
Logical, indicates if the α-shape should also be plotted. |
wlines |
"Which lines?". I.e. should the Delaunay triangulation be plotted (wlines='del'), should the Voronoi diagram be plotted (wlines='vor'), should both be plotted (wlines='both'), or none (wlines='none', the default)? |
wpoints |
Logical, indicates if sample points should be plotted. |
number |
Logical, defaulting to FALSE; if TRUE then the points plotted will be labelled with their index numbers. |
col |
The colour numbers for plotting the α-convex hull, α-shape, data points, Delaunay triangulation, Voronoi diagram, and the point numbers, in that order; defaults to c(1,1,1,1,1,1). If fewer than six numbers are given, they are recycled. (If more than six numbers are given, the redundant ones are ignored.) |
xlim |
The limits on the x-axis. |
ylim |
The limits on the y-axis. |
lwd |
The line widths for plotting the tesselations, the α-shape, and the α-convex hull, in that order; defaults to c(1,1,2). |
... |
Arguments to be passed to methods, such as graphical parameters (see par ). |
See Also
ahull
, ashape
.
Examples
# Random sample in the unit square
x<-matrix(runif(100),nc=2)
# Value of alpha
alpha<-0.2
# alpha-convex hull
ahull.obj<-ahull(x,alpha=alpha)
# Plot including the alpha-convex hull in black, alpha-shape,
# voronoi diagram and Delaunay triangulation
plot(ahull.obj)
[Package
alphahull version 0.1
Index]