Skip to contents

This lays out a graph using ggraph::create_layout() with the "dendrogram" layout, takes edge lengths from the tree, and flips the layout coordinates. The plotting functions associated with phylepic() expect the graph to be laid out using these settings.

Usage

create_tree_layout(tree, tip_data = NULL)

Arguments

tree

A tree-like graph or a phylepic object.

tip_data

A data frame with tip metadata. There must be a column called .phylepic.name with values that correspond to the names of leaf nodes in the tree. If NULL, no tip data is joined onto the tree.

Value

A "layout_ggraph" object suitable for plotting with ggplot2::ggplot`.