treehilight

Highlight specific clades of the tree by plotting a shaded area around the set of descendents of a node.

tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treehilight!(tp; nodes=[tree[1], (:d, :e)])
fig

Nodes

Draws a shaded region surrounding each of the nodes provided as a list to nodes. Assumes that each node and decendent node is accessible as nodepoints[node]. nodepoints can be accessed from tp = treeplot(tree) as tp.nodepoints.

tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treelabels!(tp),
treehilight!(tp; nodes=[tree[1]])
# Region colors will cycle with each call to `treehilight`.
treehilight!(tp; nodes=[(:d, :e)])
fig

Styling

Padding

Padding value to expand region around clade. Expects (root_edge, leave_edge, first_leaf_edge, last_leaf_edge). When plotting on Axis, the first_leaf_edge is at the bottom. If input is (num_1, num_2), the resulting padding will be (num_1, num_1, num_2, num_2), and if the input is num_1 the padding will be (num_1, num_1, num_1, num_1).

tree = ((:a, :b), (:c, (:d, :e)))
fig = Figure(size=(500,500))
ax = PolarAxis(fig[1,1]; rautolimitmargin=(0, 0.2))
hidedecorations!(ax)
tp = treeplot!(tree)
treelabels!(tp)

treehilight!(tp;
    nodes=[tree[1]],
    # padding
    padding = 0.5,
    color=:green,
    alpha=0.1,
)
treehilight!(tp;
    nodes=[tree[2][1]],
    padding = (0.5, 0.1),
    alpha=1,
    strokewidth=3,
    strokecolor=:red,
)
fig

Z shift

By default the regions are shifted back in Z direction so that the tree and other annotations

tree = ((:a, :b), (:c, (:d, :e)))
fig = Figure(size=(500,500))
ax = PolarAxis(fig[1,1]; rautolimitmargin=(0, 0.2))
hidedecorations!(ax)
tp = treeplot!(tree)
treelabels!(tp)

treehilight!(tp;
    nodes=[tree[2][2]],
    padding = (0.5, 0.1),
    alpha=1,
    z_shift=0,
)
fig

Reference

BasicTreePlots.treehilightFunction

treehilight!(nodepoints::OrderedDict(node => coordinate); nodes = [node1, node2])

Examples

tree = ((:a, :b), (:c, (:d, :e)))
fig, ax, tp = treeplot(tree)
treehilight!(tp; nodes=[tree[1], (:d, :e)])
fig

Plot type

The plot type alias for the treehilight function is TreeHilight.

Attributes

alpha = @inherit alpha 0.25 — Sets the alpha value of the shaded region in the tree area.

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 patchcolor — Sets the color of the tree area.

cycle = [:color => :patchcolor] — Sets which attributes to cycle when creating multiple plots. The values to cycle through are defined by the parent Theme. Multiple cycled attributes can be set by passing a vector. Elements can

  • directly refer to a cycled attribute, e.g. :color
  • map a cycled attribute to a palette attribute, e.g. :linecolor => :color
  • map multiple cycled attributes to a palette attribute, e.g. [:linecolor, :markercolor] => :color

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.

model = automatic — Sets a model matrix for the plot. This overrides adjustments made with translate!, rotate! and scale!.

nodes = nothing — List of nodes for which to draw surrounding regions. Assumes that each node and decendent node is accessible as nodepoints[node]. nodepoints can be accessed from tp = treeplot(tree) as tp.nodepoints.

overdraw = false — Controls if the plot will draw over other plots. This specifically means ignoring depth checks in GL backends

padding = 0.1 — Padding value to expand region around clade. Expects (root_edge, leave_edge, first_leaf_edge, last_leaf_edge). When plotting on Axis, the first_leaf_edge is at the bottom. If input is (num_1, num_2), the resulting padding will be (num_1, num_1, num_2, num_2), and if the input is num_1 the padding will be (num_1, num_1, num_1, num_1).

resolution = 30No docs available.

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.

strokecolor = (:black, 1.0) — Color of stroke around shaded region.

strokewidth = @inherit strokewidth 0.0 — Width of stroke line around shaded region

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 child space is 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.

z_shift = -1 — Allows default shifting of clade areas to back of plot; input into Makie.translate!(plt, 0, 0, plt.z_shift[])

source