plottree: Display merger tree

Description Usage Arguments Author(s) See Also Examples

View source: R/plottree.R

Description

Visualise rooted directional trees, such as the merger trees of halos and galaxies.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
plottree(
  tree = NULL,
  normalize.mass = TRUE,
  sort = TRUE,
  spacetype = 3,
  straightening = 0,
  simplify = FALSE,
  style = 3,
  circle.height = 0,
  root.length = 0.5,
  leaf.length = 0.5,
  margin = 0.03,
  col = rainbow(100, start = 0, end = 5/6),
  draw.edges = TRUE,
  draw.vertices = FALSE,
  draw.box = TRUE,
  add = FALSE,
  xlim = c(0, 1),
  ylim = c(0, 1),
  scale = 1,
  gamma = 1,
  min = 0,
  vertex.size = 1,
  pdf.filename = NULL,
  pdf.size = 5,
  forced.x = NULL,
  forced.y = NULL,
  overlap = 0.001
)

Arguments

tree

list of vectors of equal lengths (n), specifying the n vertices (halos) a tree. These vectors are:

descendant (mandatory) specifies a descendant index for each vertex. This vector must contain one zero, which specifies the root vertex. All other values must be positive integers.

mass (optional) specifies contains the masses of the vertices. If not given, the mass will be chosen equal to the number of leaves in the subtree leading to this node.

value (optional) contains values, normalized to [0,1], to be displayed in colour.

length (optional) number of vertical steps ("snapshots") to the descendant of each vertex. If not given, the default values is one.

normalize.mass

logical flag specifying whether the masses should be normalized to the root mass

sort

logical flag, specifying if the branches are ordered such that higher mass branches are more central

spacetype

integer, specifying how much horizontal space is allocated to each progenitor branch: 1=all progenitors get equal space, 2=proportional to number of leaves, 3=proportional to mass

straightening

real between 0 and 1 specifying the maximal mass-ratio up to which it is enforced that the main progenitor is strictly vertically above its descendant.

simplify

logical flag. If TRUE, all the vertices, other than the root, with only one progenitor are removed for graphical simplicity.

style

integer value to specify the rendering: 1=straight lines, 2=splines, 3=polygon splines with optimal vertex-matching

circle.height

real between 0 and 1 specifying the relative vertical height of circles drawn at the nodes (only with style=3)

root.length

length of the root branch, extending down from the root halo

leaf.length

length of the leaf branches, extending up from the leaves

margin

thickness of margin surrounding the plot

col

colour of the edges; or a vector of colours if values have been specified in the tree

draw.edges

logical flag to turn on/off edges

draw.vertices

logical flag to turn on/off vertices

draw.box

logical flag to turn on/off a black frame around the box

add

logical flag specifying whether the plot should be added to an existing plot

xlim

horizontal range of the tree with margin (only needed if add = TRUE)

ylim

vertical range of the tree with margin (only needed if add = TRUE)

scale

scaling factor to convert masses into line widths

gamma

scaling exponent to convert masses into line widths

min

minimum linewidth

vertex.size

scaling factor of the vertex size

pdf.filename

optional file name of a PDF file to be saved

pdf.size

optional size of the PDF image

forced.x

optional vector allowing the user to enforce the x-positions of individual nodes. Use NAs for automatic values.

forced.y

optional vector allowing the user to enforce the y-positions of individual nodes. Use NAs for automatic values.

overlap

optional number specifying a small vertical overlap between branches to avoid spurious gaps in graphical outputs

Author(s)

Danail Obreschkow

See Also

buildtree

Examples

1
2
3
4
5
6
## plot default tree
plottree()

## show a simple custom tree
tree = list(mass = c(1,0.6,0.1,0.5,0.4), descendant = c(0,1,2,2,1))
plottree(tree)

obreschkow/mergertrees documentation built on June 25, 2021, 6:40 p.m.