Description Usage Arguments Value
Plots a tree or a list of trees using
ggplot
.
ggphylo
provides convenient functions and tools
for visualizing phylogenetic data in R. Many methods are
provided to simplify the process of working with
phylo
objects (e.g., tree.scale.to
and tree.translate
, while two plotting
methods allow for a wide range of expressive plots:
tree.plot
and aln.plot
1 2 3 |
x |
input phylo object, list of phylo objects, or a
Newick- or NHX-format tree string. When a list is given,
all trees will be arranged using |
extra.data |
an optional data.frame or string pointing to a CSV file, containing data to be linked to the input phylo object(s). The input data must contain a column named 'label', which will be used to match each row in the data to a node in the input tree(s). Defaults to NA. |
layout |
a string indicating how the tree will be laid out. Defaults to 'defualt'. Available layouts include:
|
do.plot |
a boolean indicating whether the plot should be printed to the current graphics device. When FALSE, the plot is not printed; the graphics grob is silently returned. Defaults to TRUE. |
plot.internals |
boolean, whether the labels of internal nodes should be shown. Defaults to FALSE. |
x.lab |
string, the label given to the x-axis (or, when layout='unrooted', given to both axes). Defaults to 'Branch Length'. |
x.lim |
vector of length 2, the lower and upper limits to apply to the x-axis. Defaults to NA, in which case the plot is expanded to include the entire tree. |
y.lim |
vector of length 2, the lower and upper limits to apply to the y-axis. Defaults to NA, in which case the plot is expanded to include the entire tree. |
x.expand |
vector of length 2, the fraction by which to expand the x-axis limits to the left and to the right. This is useful to allow extra space for trees with long labels or large node sizes. Defaults to c(0.05, 0.3) which extends the x-axis limits 5 the right of the default size. |
[line|node|label].[size|color|alpha].by |
string,
indicating the name of a tag value by which to modulate
the given visual property. A value of 0 will be given to
nodes which do not contain the given tag, and unless a
'x.y.scale' parameter is given (see below), the default
|
[line|node|label].[size|color|alpha].scale |
function,
used in conjunction with a corresponding 'x.y.by'
parameter (e.g. node.scale.by) to specify the type,
limits and range of the visual scaling. The value is
usually the result of one of the
In this example, 'limits' controls the
range of tag values to be shown, and 'range' controls the
range of the resulting visual scale (i.e. the node size
will range from 1 to 5). See
|
[line|node|label].[size|color|alpha] |
string or numeric, used to specify a constant value for a visual parameter if no data-based scaling is specified. Default values are:
|
the ggplot
grob list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.