style: Style Tree By Node

Description Usage Arguments Details

Description

Apply graphics parameters to parts of a tree, varying based on parent nodes. The tree gets split into different regimes; there is a base regime starting at the root, and then a series of regimes painted onto the tree using the MEDUSA algorithm. These regimes can be nested.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

Arguments

class

The class of a child member of tree_grob to style. This is passed through to tree_match as class, so anything that would be appropriate there is good here (e.g., tree_branches, tree_labels, tree_braces.

...

Named graphical parameters. E.g., pass in node5=gpar(col="red") will colour all descendents of "node5" red.

targets

A named list of targets, each element of which is a graphical parameters object. Roughly equivalent to 'list(...)'. If this is provided, then '...' must be empty. This form might be better for programmatic use. The '...' style might end up being unnecessary, even.

descendants

Apply styling to all descendants? The default is TRUE, using the MEDUSA algorithm to do this. But specifying descendants=FALSE allows styling of a single branch, node label, etc. For tips this has no effect as they have no descendants!

base

Base graphical parameters (by default the style is the gpar(), but this will change).

name

Passed through to tree_match - useful to distinguish between multiple child members with the same class (such as the tip and node labels).

Details

Generally, use the wrapper functions (tree_style_branches, tree_style_tip_labels, tree_style_node_labels) but the low-level tree_style allows changing graphical parameters of any member of the tree grob with a labels member.


richfitz/forest documentation built on May 27, 2019, 8:17 a.m.