Learn R Programming

popkin (version 1.3.13)

plot_phylo: Plot a phylo tree object

Description

This is a wrapper around ape::plot.phylo() that makes several adjustments so plots agree more with accompanying kinship matrices. In particular, tree is reversed on the y-axis to match matrix orientation, y-axis spacing is more padded for small trees, and an x-axis scale is always added.

Usage

plot_phylo(tree, xlab = "Coancestry", xmax = NULL, leg_n = 5, ...)

Arguments

tree

A phylo object to plot.

xlab

The x-axis label (default "Coancestry").

xmax

X-axis maximum limit.

leg_n

The desired number of ticks in the x-axis (input to pretty(), see that for more details).

...

Additional parameters passed to ape::plot.phylo(). However, these parameters cannot be passed: x.lim (controlled via xmax), y.lim (a better default for small trees is passed and cannot be changed) and font (takes the value of par('font') instead of ape's default of 3 (italic)).

See Also

plot_popkin() can create multipanel figures including kinship matrices and trees (calling the present function in the process).

Examples

Run this code
# NOT RUN {
# create a small random tree
library(ape)
tree <- rtree( 3 )

# plot it!
plot_phylo( tree )

# }

Run the code above in your browser using DataLab