plot.HypervolumeList {hypervolume} | R Documentation |
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 class '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=1e-04,
contour.raster.resolution=20,
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 |
plot.3d.axes.id |
Numeric identities of axes to plot in three dimensions. Defaults to 1:3 if set to |
show.axes |
If |
show.frame |
If |
show.random |
If |
show.density |
If |
show.data |
If |
names |
A vector of strings in the same order as the input hypervolumes. Used to draw the axes labels. |
show.legend |
If |
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 |
contour.lwd |
Line width used for contour lines. Ignored if |
contour.type |
Type of contour boundary: any of |
contour.alphahull.alpha |
Value of the alpha parameter for a |
contour.ball.radius.factor |
Factor used to multiply radius of ball surrounding each random point for a |
contour.kde.level |
Probability level used to delineate edges for a |
contour.raster.resolution |
Grid resolution for a |
show.centroid |
If |
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 |
verbose |
If |
... |
Additional arguments to be passed to |
Value
None; used for the side-effect of producing a plot.
Note
Contour line plotting with alphahull
requires the non-FOSS alphahull
package to be installed. Please do so in order to use this functionality!
See Also
Examples
## Not run:
# low parameter values for speed
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
hv = hypervolume_gaussian(penguins_adelie,name='Adelie')
# 2d plot
plot(hv, show.3d=FALSE)
# 3d plot
if(interactive())
{
plot(hv, show.3d=TRUE)
}
## End(Not run)