Learn R Programming

hypervolume (version 2.0.12)

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, 
   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,
   ...)

Arguments

x

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

show.3d

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.

plot.3d.axes.id

Numeric identities of axes to plot in three dimensions. Defaults to 1:3 if set to NULL.

show.axes

If TRUE, draws axes on the plot.

show.frame

If TRUE, frames the plot with a box.

show.random

If TRUE, shows random points from the hypervolume.

show.density

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.

show.data

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.

names

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

show.legend

If TRUE, draws a color legend.

limits

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.

show.contour

If TRUE, draws a boundary line saround each two-dimensional projection. Ignored if show.3d=TRUE.

contour.lwd

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

contour.type

Type of contour boundary: any of "alphahull" (alpha hull), "ball" (experimental ball covering), "kde" (2D KDE smoothing), or "raster" (grid-based rasterization).

contour.alphahull.alpha

Value of the alpha parameter for a "alphahull" contour. Can be increased to provide smoother contours.

contour.ball.radius.factor

Factor used to multiply radius of ball surrounding each random point for a "ball" contour.

contour.kde.level

Probability level used to delineate edges for a "kde" contour.

contour.raster.resolution

Grid resolution for a "raster" contour.

show.centroid

If TRUE, draws a colored point indicating the centroid for each hypervolume.

cex.centroid

Expansion factor for the centroid symbol.

colors

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

point.alpha.min

Fractional value corresponding to the most transparent value for plotting random points. 0 corresponds to full transparency.

point.dark.factor

Fractional value corresponding to the darkening factor for plotting data points. 0 corresponds to fully black.

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

num.points.max.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.

num.points.max.random

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.

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.

plot.function.additional

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.

verbose

If TRUE, prints diagnostic information about the number of points being plotted

...

Additional arguments to be passed to rgl::plot3d.

Value

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

See Also

hypervolume_save_animated_gif

Examples

Run this code
# 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