plot_tree {fractalforest}R Documentation

Visualize a fractal tree

Description

This function generates a visualization of a fractal tree based on the geometry and attributes from the build_tree function. The tree is plotted with branches and leaves. The user can customize the appearance using various parameters.

Usage

plot_tree(
  tree_df,
  d_col = NULL,
  branch_color = "black",
  leaf_color = "black",
  simplify = FALSE,
  dTolerance = 0.15
)

Arguments

tree_df

A data frame resulting from the build_tree function, containing the tree's geometry and attributes.

d_col

Name of the column that contains the diameters along the branches. Usually 'diameter'. Default is NULL (diameters are not used).

branch_color

A character string specifying the color of the tree branches. Default is 'black'.

leaf_color

A character string specifying the color of the tree leaves. Default is 'black'.

simplify

A logical value. If TRUE, simplifies the geometries of the tree branches using a given tolerance. Default is FALSE.

dTolerance

A numeric value specifying the tolerance parameter used when simplifying geometries, applicable if simplify = TRUE. Default is 0.15.

Value

A ggplot object representing the tree profile.


[Package fractalforest version 1.0.1 Index]