geom_treescale: geom_treescale

View source: R/geom_treescale.R

geom_treescaleR Documentation

geom_treescale

Description

add tree scale to a tree

Usage

geom_treescale(
  x = NULL,
  y = NULL,
  width = NULL,
  offset = NULL,
  offset.label = NULL,
  label = NULL,
  color = "black",
  linesize = 0.5,
  fontsize = 3.88,
  family = "sans"
)

Arguments

x

set x position of the scale

y

set y position of the scale

width

set the length of the tree scale

offset

set offset of text to line, defaults to NULL

offset.label

set offset of the scale title to line.

label

set the title of tree scale, defaults to NULL.

color

set color of the scale

linesize

set size of line

fontsize

set size of text

family

'sans' by default, can be any supported font

Details

'geom_treescale' automatically adds a scale bar for evolutionary distance

Value

ggplot layers

Author(s)

Guangchuang Yu

References

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


YuLab-SMU/ggtree documentation built on Nov. 3, 2024, 4:15 p.m.