treecladelabel
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treecladelabel!(tp; cladelabels=[(:a, :b) => "Clade 1", tree[2] => "Clade 2"])
fig
Clade labels
Draws a clade label for each node provided in cladelabels. Should be an iterable where each element is a pair parentnode => label. Basically [(node, label) for (node, label) in nodelabels] should not error and provide each node and label you want plotted.
if nodelabels is nothing, will default to first(last(nodepoints)) (the root of the tree), and will plot a label surrounding the full tree (assuming nodepoints has been calculated from treeplot).
Nodes and their decendent nodes should have coordinates accessible via nodepoints[node]. These coordinates can be calculated with tp = treeplot!(tree) and accessed with tp.nodepoints.
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treecladelabel!(tp; cladelabels=[tree => BasicTreePlots.label(tree), (:a, :b) => "Clade 1"])
fig
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree, axis=(; type=PolarAxis, rautolimitmargin=(0.0, 0.2)))
hidedecorations!(ax)
treecladelabel!(tp; cladelabels=[tree => BasicTreePlots.label(tree), (:a, :b) => "Clade 1"])
fig
Clade Label text styling
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree, axis=(; xautolimitmargin=(0.05, 0.4)))
treecladelabel!(tp;
cladelabels=[tree => BasicTreePlots.label(tree), (:a, :b) => "Clade 1"],
labelfont=:bold,
labelfontsize=12,
labeloffset=(10, 0),
labelalign=(:left, :center),
labelrotation=0,
color=:red,
)
fig
Clade Label line styling
lineoffset in data space at which to draw the line indicating the clade being labeled. Larger numbers move the line further from the root
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree, axis=(; xautolimitmargin=(0.05, 0.4)))
treecladelabel!(tp;
cladelabels=[tree => BasicTreePlots.label(tree), (:a, :b) => "Clade 1"],
# Pushes line away from root
lineoffset=1,
# Pads width of the line
linepadding=0.5,
linestyle=:dash,
linewidth=3,
)
fig
Reference
BasicTreePlots.treecladelabel — Function
treecladelabel(nodepoints::OrderedDict(node=>point); nodelabels=[node1 => "Node 1", node2 => "Node 2"])
Examples
tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treecladelabel!(tp; cladelabels=[(:a, :b) => "Node 1", tree[2] => "Node 2"])
figPlot type
The plot type alias for the treecladelabel function is TreeCladeLabel.
Attributes
cladelabels = nothing — List of nodes and associated labels for which to draw a clade label. Should be an iterable where each element is a pair node => label. Basically [(node, label) for (node, label) in nodelabels] should not error and provide each node and label you want plotted.
if nodelabels is nothing, will default to first(last(nodepoints)), and will plot an area surrounding the full tree (assuming nodepoints has been calculated from treeplot).
Nodes and their decendent nodes should have coordinates accessible via nodepoints[node]. These coordinates can be calculated with tp = treeplot!(tree) and accessed with tp.nodepoints.
clip_planes = @inherit clip_planes automatic — Clip planes offer a way to do clipping in 3D space. You can set a Vector of up to 8 Plane3f planes here, behind which plots will be clipped (i.e. become invisible). By default clip planes are inherited from the parent plot or scene. You can remove parent clip_planes by passing Plane3f[].
color = @inherit color (:black, 1.0f0) — No docs available.
depth_shift = 0.0 — Adjusts the depth value of a plot after all other transformations, i.e. in clip space, where -1 <= depth <= 1. This only applies to GLMakie and WGLMakie and can be used to adjust render order (like a tunable overdraw).
fxaa = true — Adjusts whether the plot is rendered with fxaa (fast approximate anti-aliasing, GLMakie only). Note that some plots implement a better native anti-aliasing solution (scatter, text, lines). For them fxaa = true generally lowers quality. Plots that show smoothly interpolated data (e.g. image, surface) may also degrade in quality as fxaa = true can cause blurring.
inspectable = @inherit inspectable — Sets whether this plot should be seen by DataInspector. The default depends on the theme of the parent scene.
inspector_clear = automatic — Sets a callback function (inspector, plot) -> ... for cleaning up custom indicators in DataInspector.
inspector_hover = automatic — Sets a callback function (inspector, plot, index) -> ... which replaces the default show_data methods.
inspector_label = automatic — Sets a callback function (plot, index, position) -> string which replaces the default label generated by DataInspector.
labelalign = @inherit align (:center, :top) — No docs available.
labelfont = @inherit font :regular — No docs available.
labelfontsize = @inherit fontsize 12.0f0 — No docs available.
labeloffset = @inherit offset (5.0f0, 0.0f0) — Offset of the text label away from anchor point in pixel space
labelrotation = @inherit rotation pi / 2 — No docs available.
lineoffset = 0.2 — Offset in data space at which to draw the line indicating the clade being labeled. Larger numbers move the line further from the root
linepadding = 0.05 — Amount to increase/decrease the width of the line in data space
lineresolution = 50 — No docs available.
linestyle = @inherit linestyle :solid — No docs available.
linewidth = @inherit linewidth 1 — No docs available.
model = automatic — Sets a model matrix for the plot. This overrides adjustments made with translate!, rotate! and scale!.
overdraw = false — Controls if the plot will draw over other plots. This specifically means ignoring depth checks in GL backends
space = :data — Sets the transformation space for box encompassing the plot. See Makie.spaces() for possible inputs.
ssao = false — Adjusts whether the plot is rendered with ssao (screen space ambient occlusion). Note that this only makes sense in 3D plots and is only applicable with fxaa = true.
transformation = :automatic — Controls the inheritance or directly sets the transformations of a plot. Transformations include the transform function and model matrix as generated by translate!(...), scale!(...) and rotate!(...). They can be set directly by passing a Transformation() object or inherited from the parent plot or scene. Inheritance options include:
:automatic: Inherit transformations if the parent and childspaceis compatible:inherit: Inherit transformations:inherit_model: Inherit only model transformations:inherit_transform_func: Inherit only the transform function:nothing: Inherit neither, fully disconnecting the child's transformations from the parent
Another option is to pass arguments to the transform!() function which then get applied to the plot. For example transformation = (:xz, 1.0) which rotates the xy plane to the xz plane and translates by 1.0. For this inheritance defaults to :automatic but can also be set through e.g. (:nothing, (:xz, 1.0)).
transparency = false — Adjusts how the plot deals with transparency. In GLMakie transparency = true results in using Order Independent Transparency.
visible = true — Controls whether the plot gets rendered or not.