geom_strip: geom_strip

View source: R/geom_strip.R

geom_stripR Documentation

geom_strip

Description

annotate associated taxa (from taxa1 to taxa2, can be Monophyletic, Polyphyletic or Paraphyletc Taxa) with bar and (optional) text label

Usage

geom_strip(
  taxa1,
  taxa2,
  label,
  offset = 0,
  offset.text = 0,
  align = TRUE,
  barsize = 0.5,
  extend = 0,
  fontsize = 3.88,
  angle = 0,
  geom = "text",
  hjust = 0,
  color = "black",
  fill = NA,
  family = "sans",
  parse = FALSE,
  ...
)

Arguments

taxa1

taxa1

taxa2

taxa2

label

add label alongside the bar (optional)

offset

offset of bar and text from the clade

offset.text

offset of text from bar

align

logical, whether to align bars to the most distant bar ,defaults to "TRUE" Note that if "FALSE", the bars might cross the tree

barsize

set size of the bar

extend

extend bar length vertically

fontsize

set size of the text

angle

set the angle of text

geom

one of 'text' or 'label'

hjust

adjust the horizonal position of the bar

color

set color for bar and label

fill

set color to fill label background, only work with geom='label'

family

"sans" by default, can be any supported font

parse

logical, whether to parse labels, if "TRUE", the labels will be parsed into expressions, defaults to "FALSE"

...

additional parameter

Value

ggplot layers

Author(s)

Guangchuang Yu

References

For more detailed demonstration of this function, please refer to chapter 5.2.1 of Data Integration, Manipulation and Visualization of Phylogenetic Trees http://yulab-smu.top/treedata-book/index.html by Guangchuang Yu.

Examples

library(ggtree)
tr<- rtree(15)
x <- ggtree(tr)
x + geom_strip(13, 1, color = "red") + geom_strip(3, 7, color = "blue")

YuLab-SMU/ggtree documentation built on April 15, 2024, 5:19 p.m.