treeGrob: Create a Tree Grob

Description Usage Arguments Value Warning Author(s)


Plot the backbone of a forest tree. This takes a tree and turns it into a graphical object that can be plotted with grid.draw (soon that part will be automated and a wrapper will be added).


treeGrob(tree, direction = "right", name = NULL, gp = gpar(), vp = NULL)



A forest tree. The underlying data do not matter at this point (but that may change in future). Note that this cannot be an ape phylo tree.


Direction in which to plot the tree. Valid options are “right” (the default), “left”, “up”, “down”, circle and semicircle. The circle version plots a tree very similar to ape's “fan” style. Or use the result of running tree_direction, which allows setting options about the direction.


Name of the grob (optional).


Graphical parameters that the segments will take. This one is really up for grabs. I'd suggest being fairly tame here and treating this as scalar values only. There is pretty much no way that non-scalar values will do the right thing. I'll sort out a nicer way of actually changing the colour of edges and things like that without relying on blindly passing in vectors and hoping for the best.


A grid viewport object that will be pushed before the object is drawn (optional)


A tree grob.


Everything up for change in the interface here. Do not depend on this or I will probably break your code.


Rich FitzJohn

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