Plots a single hypervolume or multiple hypervolumes as either a pairs plot (all axes) or a 3D plot (a subset of axes). The hypervolume is drawn as a uniformly random set of points guaranteed to be in the hypervolume.
# S3 method for HypervolumeList
plot(x,
show.3d=FALSE,plot.3d.axes.id=NULL,
show.axes=TRUE, show.frame=TRUE,
show.random=TRUE, show.density=TRUE,show.data=TRUE,
names=NULL, show.legend=TRUE, limits=NULL,
show.contour=TRUE, contour.lwd=1.5,
contour.type='kde',
contour.alphahull.alpha=0.25,
contour.ball.radius.factor=1,
contour.kde.level=0.01,
contour.raster.resolution=100,
show.centroid=TRUE, cex.centroid=2,
colors=rainbow(floor(length(x@HVList)*1.5),alpha=0.8),
point.alpha.min=0.2, point.dark.factor=0.5,
cex.random=0.5,cex.data=0.75,cex.axis=0.75,cex.names=1.0,cex.legend=0.75,
num.points.max.data = 1000, num.points.max.random = 2000, reshuffle=TRUE,
plot.function.additional=NULL,
verbose=FALSE,
...)
A Hypervolume or HypervolumeList object. The objects to be plotted.
If TRUE
, makes a three-dimensional plot of a subset of axes determined by plot.3d.axes.id
; otherwise, a pairs plot of all axes.
Numeric identities of axes to plot in three dimensions. Defaults to 1:3 if set to NULL
.
If TRUE
, draws axes on the plot.
If TRUE
, frames the plot with a box.
If TRUE
, shows random points from the hypervolume.
If TRUE
, draws random points with alpha level proportional to their unit-scaled probability density. Note that this has no effect when probability density is not relevant, i.e. for hypervolumes that are the output of set operations.
If TRUE
, draws data points from the hypervolume. Note that this has no effect if the hypervolume is not associated with data points, e.g. for those that are the output of set operations.
A vector of strings in the same order as the input hypervolumes. Used to draw the axes labels.
If TRUE
, draws a color legend.
A list of two-element vectors corresponding to the axes limits for each dimension. If a single two-element vector is provided it is re-used for all axes.
If TRUE
, draws a boundary line saround each two-dimensional projection. Ignored if show.3d=TRUE
.
Line width used for contour lines. Ignored if show.contour=FALSE
.
Type of contour boundary: any of "alphahull"
(alpha hull), "ball"
(experimental ball covering), "kde"
(2D KDE smoothing), or "raster"
(grid-based rasterization).
Value of the alpha parameter for a "alphahull"
contour. Can be increased to provide smoother contours.
Factor used to multiply radius of ball surrounding each random point for a "ball"
contour.
Probability level used to delineate edges for a "kde"
contour.
Grid resolution for a "raster"
contour.
If TRUE
, draws a colored point indicating the centroid for each hypervolume.
Expansion factor for the centroid symbol.
A vector of colors to be used to plot each hypervolume, in the same order as the input hypervolumes.
Fractional value corresponding to the most transparent value for plotting random points. 0 corresponds to full transparency.
Fractional value corresponding to the darkening factor for plotting data points. 0 corresponds to fully black.
cex value for uniformly random points.
cex value for data points.
cex value for axes, if pair=T.
cex value for variable names printed on the diagonal, if pair=T.
cex value for the legend text
An integer indicating the maximum number of data points to be sampled from each hypervolume. Lower values result in faster plotting and smaller file sizes but less accuracy.
An integer indicating the maximum number of random points to be sampled from each hypervolume. Lower values result in faster plotting and smaller file sizes but less accuracy.
A logical value relevant when pair=TRUE. If false, each hypervolume is drawn on top of the previous hypervolume; if true, all points of all hypervolumes are randomly shuffled so no hypervolume is given visual preference during plotting.
Any function(i,j)
that will add additional plotting commands for column i
and row j
of the pairs plot. Should not create new plots or change par()
settings. Has no effect if show.3d=TRUE
.
If TRUE
, prints diagnostic information about the number of points being plotted
Additional arguments to be passed to rgl::plot3d
.
None; used for the side-effect of producing a plot.
# NOT RUN {
data(iris)
hv = hypervolume_gaussian(iris[,1:3])
plot(hv, show.3d=TRUE)
plot(hv, show.3d=FALSE)
plot(hv,plot.function.additional=function(i,j){
points( x=iris[iris$Species=="setosa",i],
y=iris[iris$Species=="setosa",j],col='purple')
})
# }
Run the code above in your browser using DataLab