autoplot.mtg: Plot an MTG

Description Usage Arguments Details Value Examples

View source: R/plot_MTG.R

Description

Plot an MTG

Usage

1
2
3
4
5
## S3 method for class 'mtg'
autoplot(mtg, scale = NULL, angle = 45, phylotaxy = TRUE, ...)

## S3 method for class 'Node'
autoplot(mtg, scale = NULL, angle = 45, phylotaxy = TRUE, ...)

Arguments

mtg

An MTG, as from read_mtg()

scale

The scale required for plotting

angle

Insertion angle when branching

phylotaxy

Is phylotaxy required ? Uses 180 degrees if TRUE.

...

Further arguments. plotly_mtg() uses this to add variables to the output data.

Details

The function needs the topological orders as attributes in the MTG. If they are not present, it uses topological_order() to compute it with descending order. If you need ascending order, please use topological_order(MTG, ascend = TRUE) before plotting.

Value

A ggplot of the MTG

Examples

1
2
3
4
library(ggplot2)
filepath= system.file("extdata", "simple_plant.mtg", package = "XploRer")
MTG= read_mtg(filepath)
autoplot(MTG)

VEZY/XploRer documentation built on Oct. 9, 2021, 10:05 p.m.