Yesterday, I tweeted a plot giving an arc-style tree with arc text.
An "arc" style phylogeny by #Rstats #phytools and arc text by #plotrix, plus phytools 2.0 has a pre-print (in revision): https://t.co/S3yL9ZQezM. pic.twitter.com/NMJno3u83s
— Liam Revell (@phytools_liam) May 18, 2023
Since people seem to like this, I thought I’d post the code. The arc text uses the plotrix function arctext
.
library(phytools)
tree<-pbtree(n=1200,scale=18)
arc_height<-1.8
par(fg="white",bg="#242B64")
plotTree(tree,ftype="off",type="arc",color="grey",arc_height=1.8,
ylim=c(0,3.2*max(nodeHeights(tree))))
library(plotrix)
text(x=0,y=1.08*(arc_height+1)*max(nodeHeights(tree)),
"phytools 2.0",cex=4)
arctext("An updated R ecosystem for phylogenetic comparative methods",
radius=30,cex=2.4)
text(x=0,y=24,"(and other things)",cex=1.8)
That’s it folks!
No comments:
Post a Comment
Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.