Skip to content

Instantly share code, notes, and snippets.

@dwbapst
Last active March 15, 2019 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwbapst/f6f1da426df46907b64e4b9df63cb39d to your computer and use it in GitHub Desktop.
Save dwbapst/f6f1da426df46907b64e4b9df63cb39d to your computer and use it in GitHub Desktop.
Code for Plotting a Nice 78-Taxon Phylogeny with Stratigraphic Ranges, Upward Orientation, Phylopics, White Foreground Color with Black Background, etc
devtools::install_github("dwbapst/paleotree", ref="dev_refinedphylopicfun")
library(paleotree)
taxaSeventyEight <- c(
"Archaeopteryx", "Pinus", "Procoptodon", "Olenellus", "Eldredgeops",
"Quetzalcoatlus", "Homo", "Tyrannosaurus", "Triceratops", "Giraffa",
"Bolivina", "Cancer", "Dicellograptus", "Dunkleosteus", "Solanum",
"Anomalocaris", "Climacograptus", "Halysites", "Cyrtograptus",
"Procoptodon", "Megacerops", "Moropus", "Dimetrodon", "Lingula",
"Rhynchosaurus", "Equus", "Megaloceros", "Rhynchotrema", "Pecten",
"Echinaster", "Eocooksonia", "Neospirifer", # "Prototaxites",
"Cincinnaticrinus", "Nemagraptus", "Monograptus", "Pongo", "Acropora",
"Histiodella", "Agathiceras", "Juramaia", "Opabinia", "Arandaspis",
"Corvus", "Plethodon", "Latimeria", "Phrynosoma", "Araucarioxylon",
"Velociraptor", "Hylonomus", "Elginerpeton", "Rhyniognatha",
"Tyto", "Dromaius", "Solenopsis", "Gorilla", "Ginkgo", "Terebratella",
"Caretta", "Crocodylus", "Rosa", "Prunus", "Lycopodium", "Meganeura",
"Diplodocus", "Brachiosaurus", "Hepaticae", "Canadaspis", "Pikaia",
"Smilodon", "Mammuthus", "Exaeretodon", "Redondasaurus", "Dimetrodon",
"Megatheriidae", "Metasequoia", "Aedes", "Panthera", "Megalonyx")
data <-getSpecificTaxaPBDB(taxaSeventyEight)
tree <- makePBDBtaxonTree(data, rank = "genus")
timeTree <- dateTaxonTreePBDB(tree,
minBranchLen = 10)
file <- "tree_taxa78_03-15-19c.png"
png(file = file,
height = 5, width = 12,
units = "in", res = 300)
par(bg="black")
par(mar=c(0,0,3,0))
taxaColors <- rep("white",Ntip(timeTree))
taxaColors[4] <- "red"
plotPhyloPicTree(
tree = timeTree,
orientation = "upwards",
addTaxonStratDurations = TRUE,
edge.color = "white",
maxAgeDepth = 700,
taxaColor=taxaColors,
depthAxisPhylo = TRUE,
colorAxisPhylo = "white")
dev.off()
shell.exec(file)
@dwbapst
Copy link
Author

dwbapst commented Mar 15, 2019

tree_taxa78_03-15-19c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment