shipunov (version 1.5)

Plot.phylocl: Plot phylogenetic tree with clades collapsed

Description

Plot phylogenetic tree with clades collapsed into triangles or rectangles

Usage

Plot.phylocl(tree, cl, strict=TRUE, what="triangles", col.ed="black",
 col.td="black", col.etr="transparent", col.ttr="transparent", col.pfl="lightgrey",
 col.pbr="black", lty.p=1, lwd.p=1, col.ct="black", ct.off=0, ct.fnt=1,
 longer="0%", ...)

Arguments

tree

phylo object

cl

two columns classification table

strict

default TRUE: do not join all descendants

what

default "triangles", also possible to use "rectangles"

col.ed

default "black", default edge color

col.td

default black", default tips color

col.etr

default "transparent", color to suppress original edges

col.ttr

default "transparent", color to suppress original tips

col.pfl

default "lightgrey", fill color for polygons

col.pbr

default "black", border color of polygons

lty.p

default 1, line type of polygon borders

lwd.p

default 1, line width

col.ct

default "black", color of clade labels

ct.off

default 0, text offset of clade labels

ct.fnt

default 1, text font of clade labels

longer

default "0%", percent to increase xlim to fit longer clade labels

...

options to ape::plot.phylo()

Value

Returns list of clade names.

Details

Plot.phylocl() plots phylogenetic tree with clades collapsed into triangles or rectangles.

Alternative is phytools::plot.backbonePhylo() which however requires more manual work.

Some tricks used (null plotting and transparent elements), the last one is actually useful in other ways.

Intersections and other deviated cases not controlled. However, they are really easy to spot.

All parameters of polygons should be either "scalars" or vectors of the same length as clade list (minus monotypic clades), clades are in alphabetical order. To help, list of clade names is invisibly returned in the end.

See Also

phytools::plot.backbonePhylo()

Examples

Run this code
# NOT RUN {
aa.d <- hclust(dist(t(atmospheres)))
tree <- ape::unroot(ape::as.phylo(aa.d))
cl <- data.frame(planet=c("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn",
 "Uranus", "Neptune"),
clade=c("Earth group", "Earth group", "Earth group", "Earth group", "Close giants",
 "Close giants", "Distant giants", "Distant giants"), stringsAsFactors=FALSE)
Plot.phylocl(tree, cl, longer="5%")
# }

Run the code above in your browser using DataLab