Reference
Contents
Index
BasicTreePlots.distance
— Methoddistance(node)
return scaler distance from node to parent of node. Defaults to 1
To extend treeplot
to your type define method for BasicTreePlots.distance(node::YourNodeType)
BasicTreePlots.label
— Methodlabel(node)
return string typed value or description of node.
Defaults to string(nodevalue(node))
To extend treeplot
to your type define method for BasicTreePlots.label(node::YourNodeType)
BasicTreePlots.treeplot
— Functiontreeplot(tree; kwargs...)
Args:
- tree, the root node of a tree that has
AbstractTrees.children()
defined. All nodes should be reachable by usingAbstractTrees.PreOrderDFS()
iterator.
Keyword arguments:
showroot::Bool = false
, ifBasicTreePlots.distance()
is notnan
for root, show line linking root to parent.layoutstyle::Symbol = :dendrogram
available options are:dendrogram
, or:cladogram
:dendrogram
displays tree taking into account the distance between parent and children nodes as calculated fromBasicTreePlots.distance(node)
. If the distance is not defined, it defaults to1
and is equivalent to the:cladogram
layout:cladogram
displays the tree where each distance from a child node to their parent is set to1
.
branchstyle::Symbol = :square
available options are:square
or:straight
:square
will display line from child to parent as going back to the height of the parent, before connecting back to the parent node at a right angle.straight
will display line from child to parent as a straight line from child to parent.
linecolor = :black
, should match thecolor
option in Makie'slines
plot. Can be either a single color:black
, color plus alpha transperency(:black, 0.5)
, or a vector of numbers for each node in pre-walk order. color for each node is associated to the line connecting it to its parent.linewidth = 1
, should match thelinewidth
option in Makie'slines
plot. Can be either a single width or a vector of numbers for each node in pre-walk order. width for each node is associated to the line connecting it to its parent.linecolormap=:viridis
color map associated tolinecolor
. can be symbel of known colormap or gradient created fromcgrad()
. see Makie's color documentationbranch_point_resolution = 25
, number of points associated to each line segment. Can be decreased to increase plotting speed. Or, increased if lines that should be smooth are not.usemaxdepth = false
, iftrue
draw guide lines from each leaf tip to the depth of the leaf that is maximally distant from root. Useful for connecting leaves to there location on the y axis (or θ axis if plotted onPolarAxis
).tipannotationsvisible::Bool = true
, whether to show text labels for each leaf tip.tipfontsize = 9.0f0
, font size that tip labels are displayed at.openangle = 0
, Angle in radians that limits span of tree around the circle when plotted onPolarAxis
. ifopenangle = deg2rad(5)
then leaf tips will spread across angles0
to(2π - openangle)
.tipalign = (:left, :center)
text alignment of tip labels. see Makie optionstipannotationoffset = (3.0f0, 0.0f0)
offset of tip label from actual tip position. The first value is associated with thex
axis, and the second is associated with they
axis. (Currently, only available for cartisian axis)