Learn R Programming

FossilSim (version 2.4.1)

plot.taxonomy: 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 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,
  taxa.palette = "viridis",
  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).

taxa.palette

Colour palette used for taxa. Colours are assigned to taxa using the function grDevices::hcl.colors() and the default palette is "viridis". Other colour blind friendly palettes include "Blue-Red 3" and "Green-Brown".

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

Run this code
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)

Run the code above in your browser using DataLab