geom_inset | R Documentation |
gemo_inset can add subplots to tree by accepting a list of ggplot objects that are ancestral stats or data associated with selected nodes in the tree. These ggplot objects can be any kind of charts or hybrid of of these charts.
add subplots as insets in a tree
geom_inset(
insets,
width = 0.1,
height = 0.1,
hjust = 0,
vjust = 0,
x = "node",
reverse_x = FALSE,
reverse_y = FALSE
)
inset(
tree_view,
insets,
width,
height,
hjust = 0,
vjust = 0,
x = "node",
reverse_x = FALSE,
reverse_y = FALSE
)
insets |
a list of ggplot objects, named by node number |
width |
width of the inset, relative to the range of x-axis, defaults to .1 |
height |
height of the inset, relative to the range of y-axis, defaults to .1 |
hjust |
adjust the horizontal position of the charts, charts will go left if hjust > 0 |
vjust |
adjust the vertical position of the charts, charts will go down if vjust > 0 |
x |
the position where users want to place the charts, one of 'node' (default) and 'branch' |
reverse_x |
whether to reverse x axis of the charts by 'ggplot2::scale_x_reverse', defaults to 'FALSE' |
reverse_y |
whether to reverse y axis of the charts by 'ggplot2::scale_y_reverse', defaults to 'FALSE' |
tree_view |
tree view |
Users can also use
inset layer
tree view with insets
Guangchuang Yu
For demonstration of this function, please refer to chapter 8.3 of Data Integration, Manipulation and Visualization of Phylogenetic Trees http://yulab-smu.top/treedata-book/index.html by Guangchuang Yu.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.