plotnj {phyclust} | R Documentation |
This is a enhanced version of plot.phylo
in ape which
can plot trees in Class phylo
including neighbor-joining trees,
unrooted trees, trees with star shapes, ... etc.
plotnj(unrooted.tree, X.class = NULL, type = "u", main = NULL, show.tip.label = FALSE, show.node.label = FALSE, edge.width = 1, edge.width.class = edge.width, ...)
unrooted.tree |
an unrooted tree in |
X.class |
class ids indicated for all tips. |
type |
plot types, see |
main |
main label. |
show.tip.label |
show tip label if available. |
show.node.label |
show node label if available. |
edge.width |
edge width for all internal branches if |
edge.width.class |
edge width for tip branches if |
... |
other options passed to |
This function is built to plot unrooted trees, but it may also apply
for other trees in Class phylo
.
type
can be "u", "p", "c", "f", "r" as in plot.phylo
.
If X.class
is set, then the tip branches will be drawn with
colors by class ids, and the colors are controlled by .color
.
The width of branches is controlled by edge.width
for all internal
branches and by edge.width.class
for tip branches.
Return a tree plot.
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: http://snoweye.github.io/phyclust/
## Not run: library(phyclust, quiet = TRUE) set.seed(1234) ret.ms <- ms(nsam = 24, opts = "-T -G 0.5") tree.anc <- read.tree(text = ret.ms[3]) is.rooted(tree.anc) tree.new <- as.star.tree(tree.anc) X.class <- rep(1:6, each = 4) par(mfrow = c(2, 2)) plotnj(tree.anc, X.class, type = "u", edge.width.class = 2, main = "unrooted tree") plotnj(tree.new, X.class, type = "u", edge.width.class = 2, main = "star tree") plotnj(tree.anc, X.class, type = "c", edge.width.class = 2, main = "unrooted tree in cladogram") plotnj(tree.new, X.class, type = "r", edge.width.class = 2, main = "star tree in radial") ## End(Not run)