Description Usage Arguments Details References See Also Examples
View source: R/tpColorPlot3d.R
This function enhances a three-dimensional scatter plot by enabling transparency control of color annotation. In addition, it provides option for phylogenetic tree superimposition.
1 2 |
x |
a matrix with rows representing samples and columns representing three variables of interest, typically principal components |
r |
radius of plotting sphere |
phylo |
if TRUE, coordinates of ancestral nodes from a supplied phylogeny ( |
phy |
an object of class |
labcol |
a character vector specifying species colors |
xyzlabel |
a vector of characters specifying the titles for the xyz-axes |
alpha.set |
a constant for controlling degree of transparency (0 for complete transparency; 1 for solid color) of the data points |
mean.show |
if TRUE, the centroids of each species is plotted in solid color |
asp |
a vector specifying the aspect ratio of the xyz axes; the default gives a cube |
Transparency control of color-annotated data points reduces visual saturation caused by the use of solid colors for all
data points. Guide for choosing optimal value of r
: for data range between -0.1 and 0.1, a value of 0.005 should be adequate.
If a phylogenetic tree is supplied, it may be superimposed onto the three-dimensional space to allow visualization of
evolutionary trajectories.
Khang TF, Soo OYM, Tan WB, Lim LHS. (2016). Monogenean anchor morphometry: systematic value, phylogenetic signal, and evolution. PeerJ 4:e1668.
Paradis E, Claude J & Strimmer K. (2004). APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20: 289-290.
Revell LJ. (2012). phytools: An R package for phylogenetic comparative biology (and other things). Methods in Ecology and Evolution 3:217-223.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(phytools)
library(rgl)
data(ligophorus_shape)
data(ligotree)
data(spcolmap)
#Perform PCA of shape data for dorsal anchors and make 2D plots
pcashape <- pca2d(ligophorus_shape[,23:44], labcol=spcolmap$color,
phylo=TRUE, phy=ligotree, genus="L. ", bound.y=c(-0.08, 0.1),
bound.x1=c(-0.2,0.2), bound.x2 = c(-0.2,0.2))
#Check for proportion of variation explained by each PC
summary(pcashape$pca)
#A closer look with 3D plot
tpColorPlot3d(pcashape$scores[,3:1], r=0.005, phylo=TRUE, phy=ligotree, labcol=spcolmap$color,
xyzlabel=c("PC3 (8%)","PC2 (10%)","PC1 (61%)"), mean.show=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.