Description Usage Arguments Details Value Aesthetics Author(s) Examples
layer of hilight clade
1 2 3 |
data |
data.frame, The data to be displayed in this layer, default is NULL. |
mapping |
Set of aesthetic mappings, default is NULL. |
node |
selected node to hilight, when data and mapping is NULL, it is required. |
type |
the type of layer, default is |
... |
additional parameters, see also Aesthetics section. |
geom_hilight supports data.frame as input. And aesthetics of layer can be mapped.
you can see the Aesthetics section to set parameters.
a list object.
geom_hilight() understands the following aesthetics for rectangular layer (required
aesthetics are in bold):
node selected node to hight light, it is required.
colour the colour of margin, default is NA.
fill the colour of fill, default is 'steelblue'.
alpha the transparency of fill, default is 0.5.
extend extend xmax of the rectangle, default is 0.
extendto specify a value, meaning the rectangle extend to, default is NULL.
linetype the line type of margin, default is 1.
size the width of line of margin, default is 0.5.
geom_hilight() understands the following aesthethics for encircle layer (required
aesthetics are in bold):
node selected node to hight light, it is required.
colour the colour of margin, default is 'black'.
fill the colour of fill, default is 'steelblue'.
alpha the transparency of fill, default is 0.5.
expand expands the xspline clade region, default is 0.
spread control the size, when only one point.
size the width of line of margin, default is 0.5.
linetype the line type of margin, default is 1.
s_shape the shape of the spline relative to the control points, default is 0.5.
s_open whether the spline is a line or a closed shape, default is FALSE.
Guangchuang Yu and Shuangbin Xu
1 2 3 4 5 6 7 8 9 | library(ggplot2)
set.seed(102)
tree <- rtree(60)
p <- ggtree(tree)
p1 <- p + geom_hilight(node=62) + geom_hilight(node=88, fill="red")
p1
dat <- data.frame(id=c(62, 88), type=c("A", "B"))
p2 <- p + geom_hilight(data=dat, mapping=aes(node=id, fill=type))
p2
|
Registered S3 method overwritten by 'treeio':
method from
root.phylo ape
ggtree v2.4.1 For help: https://yulab-smu.top/treedata-book/
If you use ggtree in published research, please cite the most appropriate paper(s):
[36m-[39m Guangchuang Yu. Using ggtree to visualize data on tree-like structures. Current Protocols in Bioinformatics, 2020, 69:e96. doi:10.1002/cpbi.96
[36m-[39m Guangchuang Yu, Tommy Tsan-Yuk Lam, Huachen Zhu, Yi Guan. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution 2018, 35(12):3041-3043. doi:10.1093/molbev/msy194
[36m-[39m Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.