plot | R Documentation |
Plot phylogenetic trees, with or without regime paintings.
## S4 method for signature 'ouchtree'
plot(
x,
...,
regimes = NULL,
ladderize = TRUE,
node.names = FALSE,
legend = !is.null(regimes),
labels,
frame.plot = FALSE,
palette = rainbow,
margin = 0.1,
text_opts = list(),
legend_opts = list()
)
## S4 method for signature 'hansentree'
plot(x, ..., regimes, legend = TRUE)
x |
object to plot. |
... |
additional arguments, passed to |
regimes |
factor or character; a vector of regime paintings. |
ladderize |
logical; should the tree be ladderized? |
node.names |
logical; should node names be displayed? |
legend |
logical; display a legend? |
labels |
character; taxon labels. |
frame.plot |
a logical indicating whether a box should be drawn around the plot. |
palette |
function or character; specifies the colors to be used for the several regimes on the tree.
Specified as a function, when given an integer, |
margin |
numeric; width of the right margin (as a fraction of the plot width).
Adjust this if labels are clipped (see Examples below).
One can also adjust the width of the left margin (for example to aid in the formatting of the figure legend).
To do this, furnish |
text_opts |
options for the labels; passed to |
legend_opts |
options for the the legend; passed to |
Other methods for ouch trees:
as_data_frame
,
bootstrap()
,
coef()
,
logLik
,
ouch-package
,
paint()
,
print()
,
simulate()
,
summary()
,
update()
tree <- with(
bimac,
ouchtree(nodes=node,ancestors=ancestor,times=time,labels=spcode)
)
plot(tree)
plot(tree, node.names=TRUE) # display node names
## When taxon names are long, they are cut off when the
## default settings are used. For example:
tree2 <- with(
bimac,
ouchtree(nodes=node,ancestors=ancestor,times=time,
labels=ifelse(is.na(species),NA,paste(species,island,sep=", "))
)
)
plot(tree2) # long species names are cut off
## This is fixed by increasing right margin and font size:
plot(tree2,margin=0.35,text_opts=list(cex=0.7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.