Learn R Programming

hypervolume (version 1.4.1)

plot.HypervolumeList: Plot a hypervolume or list of hypervolumes

Description

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.

Usage

# S3 method for HypervolumeList
plot(x, 
npmax_data = 1000, npmax_random = 2000, 
colors=rainbow(length(x@HVList),alpha=0.8), names=NULL, 
reshuffle=TRUE, showrandom=TRUE, showdensity=TRUE,showdata=TRUE,darkfactor=0.5,
cex.random=0.5,cex.data=0.75,cex.axis=0.75,cex.names=1.0,cex.legend=0.75,
legend=TRUE, varlims=NULL, 
showcontour=TRUE, contour.lwd=1, contour.filled=FALSE,contour.filled.alpha=0.5,
contour.factor=0.05, showcentroid=TRUE, cex.centroid=3,
pairplot=TRUE,whichaxes=NULL,...)

Arguments

x

A Hypervolume or HypervolumeList object. The objects to be plotted.

npmax_data

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.

npmax_random

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.

colors

A vector of colors to be used to plot each hypervolume, in the same order as the input hypervolumes.

names

A vector of strings in the same order as the input hypervolumes. Used to draw the axes labels.

reshuffle

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.

showrandom

A logical value indicating whether the random points comprising the hypervolume should be drawn.

showdensity

A logical value indicating whether the probability density of each hypervolume should be drawn by modulating alpha values (more transparent for lower 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. Used only if showrandom=TRUE.

showdata

A logical value indicating whether the original data should be drawn on top of the uniformly random points. 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.

darkfactor

A value in [0,1] that modulates the color of data points, if shown. Values closer to 0 make data points more black, while values closer to 1 make data points closer to the input color.

cex.random

cex value for uniformly random points.

cex.data

cex value for data points.

cex.axis

cex value for axes, if pair=T.

cex.names

cex value for variable names printed on the diagonal, if pair=T.

cex.legend

cex value for the legend text

legend

Logical value indicating if a legend should be plotted, if pair=T.

varlims

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.

showcontour

A logical value indicating whether a boundary line should be drawn around each two-dimensional projection. Ignored if pair=FALSE.

contour.lwd

Line width used for contour lines. Ignored if showcontour=FALSE.

contour.filled

A logical value indicating whether contours should be shaded. Ignored if showcontour=FALSE.

contour.filled.alpha

An alpha value used to determine the transparency of shaded contours. Ignored if contour.filled=FALSE.

contour.factor

A numeric value that controls the threshold level at which the contour is drawn. Scaled so that 0 includes all data and 1 includes no data. Ignored if showcontour=FALSE.

showcentroid

A logical value indicating whether a solid point indicating the centroid for each hypervolume should be drawn. Centroids are randomly jittered by 1 percent to improve visual clarity.

cex.centroid

Expansion factor for the centroid symbol.

pairplot

If true, a pair plot is produced. If false, a 3D plot is produced.

whichaxes

A length-three vector of integer IDs corresponding to the axes to be plotted when pair=F.

...

Value

None; used for the side-effect of producing a plot.

Examples

Run this code
# NOT RUN {
data(iris)
hv1 = hypervolume(subset(iris, Species=="setosa")[,1:4],reps=1000,bandwidth=0.2)

# choose fixed axes
plot(hv1, pair=TRUE, varlims=list(c(3,6),c(2,5),c(0,3),c(-1,1)))
# }

Run the code above in your browser using DataLab