plot.taxonomy: Plot simulated taxonomy

View source: R/plot.taxonomy.R

plot.taxonomyR Documentation

Plot simulated taxonomy

Description

This function is adapted from the ape function plot.phylo used to plot phylogenetic trees. The function can be used to plot simulated taxonomy along with the corresponding tree.

Usage

## S3 method for class 'taxonomy'
plot(
  x,
  tree,
  show.mode = TRUE,
  show.legend = TRUE,
  legend.position = "bottomleft",
  root.edge = TRUE,
  hide.edge = FALSE,
  edge.width = 1,
  show.tip.label = FALSE,
  align.tip.label = FALSE,
  cex = 1.2,
  ...
)

Arguments

x

Taxonomy object.

tree

Phylo object.

show.mode

Indicate speciation mode.

show.legend

Add a legend for the symbols indicating different speciation modes.

legend.position

Position of the legend. Options include "bottomleft" (default), "topleft", "bottomright", "topright" or a vector of length 2 with x, y coordinates.

root.edge

If TRUE include the root edge (default = TRUE).

hide.edge

If TRUE hide the root edge but still incorporate it into the automatic timescale (default = FALSE).

edge.width

A numeric vector giving the width of the branches of the plotted phylogeny. These are taken to be in the same order as the component edge of tree. If fewer widths are given than the number of edges, then the values are recycled.

show.tip.label

Whether to show the tip labels on the phylogeny (defaults to FALSE).

align.tip.label

A logical value or an integer. If TRUE, the tips are aligned and dotted lines are drawn between the tips of the tree and the labels. If an integer, the tips are aligned and this gives the type of the lines (lty).

cex

Numeric value giving the factor used to scale the points representing the fossils when show.fossils = TRUE.

...

Additional parameters to be passed to plot.default.

Examples

set.seed(123)

## simulate tree
t = TreeSim::sim.bd.taxa(8, 1, 1, 0.3)[[1]]

## simulate taxonomy
s = sim.taxonomy(t, 0.5, 1)

## plot the output
plot(s, t)


fossilsim/fossilsim documentation built on Jan. 4, 2024, 9:25 a.m.