facet_plot {ggtree} | R Documentation

## facet_plot

### Description

plot tree associated data in an additional panel

### Usage

    facet_plot(p, panel, data, geom, mapping = NULL, ...)

### Arguments

`p` | tree view
`panel` | panel name for plot of input data
`data` | data to plot by 'geom', first column should be matched with tip label of tree
`geom` | geom function to plot the data
`mapping` | aes mapping for 'geom'
`...` | additional parameters for 'geom'

### Details

'facet_plot()' automatically re-arranges the input 'data' according to the tree structure, visualizes the 'data' on specific 'panel' using the 'geom' function with aesthetic 'mapping' and other parameters, and align the graph with the tree 'p' side by side.

### Value

ggplot object

### Author(s)

Guangchuang Yu

### Examples

    tr <- rtree(10)
    dd = data.frame(id=tr$tip.label, value=abs(rnorm(10)))
    p <- ggtree(tr)
    facet_plot(p, 'Trait', data = dd, geom=geom_point, mapping=aes(x=value))

[Package ggtree version 1.12.7 Index]