Description Usage Arguments Examples
Function that adds a SNP scale onto a plotted phylogeny
1 2 3 4 5 6 7 8 9 | addSNPScale(
x = NULL,
y = NULL,
position = NULL,
size = 1,
lineWidth = 1,
cex = 1,
offset = 0.5
)
|
x |
An optional numeric X coordinate for the scale |
y |
An optional numeric Y coordinate for the scale |
lineWidth |
A numeric scaling factor to change the width of the scale line. Defaults to 1. Equivalent to |
cex |
A numeric scaling factor to chancge the size of the scale label. Defaults to 1. |
offset |
This value controls the distance (‘offset’) of the text label from the scale in fractions of a character width. Defaults to 0.5. |
postion |
An optional character vector detailing the location of the plot (top, middle, left, right, etc.) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Set the plotting margins
par(mar=c(0,0,0,0))
# Set the seed
set.seed(76263)
# Create a random phylogeny
tree <- ape::rtree(n=50, rooted=TRUE)
# Rescale the branch lengths to simulate SNPs
tree$edge.length <- round(tree$edge.length*10, digits=0)
# Plot the phylogeny
ape::plot.phylo(tree)
# Add a SNP scale
addSNPScale(position="bottomright", size=5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.