Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/graphical.node.patterns.R
Function to define graphical parameters to each edge when draw a phylogenetic tree. See details.
1 2 3 4 5 6 7 8 | graphical.node.patterns(
tree,
nodes,
basicpattern,
nodespatterns,
include.node = TRUE,
force.order = TRUE
)
|
tree |
phylogeny as an object of class "phylo". |
nodes |
a vector with node label to search the edges to change the basic graphical parameter. |
basicpattern |
the basic pattern for graphical parameter. This is apply for all edges. |
nodespatterns |
a vector with new graphical parameter for each node label. This change the basic graphical parameter in each node. |
include.node |
logical argument (TRUE or FALSE) to specify if edge of each node is include in change (default include.node = TRUE). |
force.order |
logical argument (TRUE or FALSE) to specify if force the search as according to edges (default force.order = TRUE). |
This function can be used to especify diferent graphical parameters (e.g. color, width and line types) for specific nodes when draw a phylogenetic tree. First, the basicpattern argument is defined for all edges of phylogenetic tree and when the basic pattern is changed in all edge within of each node, following the nodespatterns specify. The argument force.order specify if changes following order in nodes arguments step by step (this case, some changes may have no effect) or change are done from root to tips.
A vector with the new graphical parameters for each edge in phylogenetic tree.
Vanderlei Julio Debastiani <vanderleidebastiani@yahoo.com.br>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | set.seed(10)
tree <- rtree(15)
tree <- makeNodeLabel(tree)
plot.phylo(tree, show.node.label = TRUE)
edge.col <- graphical.node.patterns(tree, nodes = c("Node2", "Node8"),
basicpattern = "black", nodespatterns = c("red","blue"))
edge.col # Color vector for each edge
plot.phylo(tree, show.node.label = TRUE, edge.color = edge.col)
edge.width <- graphical.node.patterns(tree, nodes = c("Node11","Node3"),
basicpattern = 1, nodespatterns = 5, include.node = FALSE)
edge.width # width vector for each edge
plot.phylo(tree, show.node.label = TRUE, edge.width = edge.width)
tree <- rtree(250)
tree <- makeNodeLabel(tree)
plot(tree, show.tip.label = FALSE)
edge.col <- graphical.node.patterns(tree, nodes = tree$node.label,
basicpattern = "black", nodespatterns = rainbow(length(tree$node.label)))
edge.col
plot.phylo(tree, edge.color = edge.col, show.tip.label = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.