geom_tiplab | R Documentation |
add tip label layer for a tree
geom_tiplab(
mapping = NULL,
hjust = 0,
align = FALSE,
linetype = "dotted",
linesize = 0.5,
geom = "text",
offset = 0,
as_ylab = FALSE,
...
)
mapping |
aes mapping |
hjust |
horizontal adjustment, defaults to 0 |
align |
if TRUE, align all tip labels to the longest tip by adding padding characters to the left side of tip labels, defaults to "FALSE" with a line connecting each tip and its corresponding label, defaults to "FALSE" |
linetype |
set linetype of the line if align = TRUE, defaults to "dotted" |
linesize |
set line width if align = TRUE, defaults to 0.5 |
geom |
one of 'text', 'label', 'shadowtext', 'image' and 'phylopic' |
offset |
tiplab offset, horizontal adjustment to nudge tip labels, defaults to 0 |
as_ylab |
display tip labels as y-axis label, only works for rectangular and dendrogram layouts, defaults to "FALSE" |
... |
additional parameter additional parameters can refer the following parameters. The following parameters for geom="text".
The following parameters for geom="label".
The following parameters for geom="shadowtext", some parameters are like to geom="text".
The following parameters for geom="image" or geom="phylopic".
The following parameters for the line when align = TRUE.
|
'geom_tiplab' not only supports using text or label geom to display tip labels, but also supports image geom to label tip with image files or phylopics.
For adding tip labels to a tree with circular layout, 'geom_tiplab' will automatically adjust the angle of the tip labels to the tree by internally calling 'geom_tiplab2'.
tip label layer
Guangchuang Yu
For more detailed demonstration, please refer to chapter 4.3.3 of Data Integration, Manipulation and Visualization of Phylogenetic Trees http://yulab-smu.top/treedata-book/index.html by Guangchuang Yu.
require(ape)
tr <- rtree(10)
ggtree(tr) + geom_tiplab()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.