ggtreeplot: Create a ggplot next to a ggtree

View source: R/ggtree.R

ggtreeplotR Documentation

Create a ggplot next to a ggtree

Description

'ggtreeplot()' wraps 'ggplot()', and initializes a new plot in the same way. It takes a 'ggtree()' object as additional argument. It aligns the plot data by a shared label column to the tips in the tree and fixes inconsistent limits and plot expansion space.

Usage

ggtreeplot(
  ggtree,
  data = NULL,
  mapping = aes(),
  flip = FALSE,
  expand_limits = expand_scale(0, 0.6),
  ...
)

Arguments

ggtree

a ggtree plot object

data

Default dataset to use for plot. If not already a data.frame, will be converted to one by fortify(). If not specified, must be supplied in each layer added to the plot.

mapping

Default list of aesthetic mappings to use for plot. If not specified, must be supplied in each layer added to the plot.

flip

if the final plot will be flipped

expand_limits

Vector of range expansion constants used to add some padding around the data, to ensure that they are placed some distance away from the axes. Use the convenience function 'expand_scale()' to generate the values for the 'expand' argument. The defaults are to expand the scale by 0.6 units on each side for discrete variables. In contrast to the 'expand' argument of the the scales functions, this expansion space is directly added to the limits, thus all data within the limit+expansions space is plotted.

...

Other arguments passed on to methods. Not currently used.

Source

https://thackl.github.io/ggtree-composite-plots


thackl/thacklr documentation built on Oct. 16, 2023, 9:15 p.m.