Who knew that I should have been using this as a guide all along!
In the end, though (and with some tweaking of the settings from their default values, and a little post-hoc editing), my function does a pretty good job:
> require(phytools)
Loading required package: phytools
Loading required package: ape
...
> require("extrafont")
Loading required package: extrafont
> tree<-read.tree(text="((mammals,(birds,reptiles)),amphibians);")
> tree<-compute.brlen(tree)
> xkcdTree(tree,file="herpetology.pdf",lwd=2,color="black", dim=c(4,4),jitter=0.001,waver=c(0.03,0.03))
**** NOTE: use in Windows requires ...
>
Loading required package: phytools
Loading required package: ape
...
> require("extrafont")
Loading required package: extrafont
> tree<-read.tree(text="((mammals,(birds,reptiles)),amphibians);")
> tree<-compute.brlen(tree)
> xkcdTree(tree,file="herpetology.pdf",lwd=2,color="black", dim=c(4,4),jitter=0.001,waver=c(0.03,0.03))
**** NOTE: use in Windows requires ...
>
That's it! |
slow clap...
ReplyDeleteNathan Yau just featured a selection of xkcd-style charts (R, Java, Python) on his data visualization blog, FlowingData
ReplyDeletehttp://flowingdata.com/2012/10/19/xkcd-style-charts-in-r-javascript-and-python/
Cool. Thanks.
Delete