Quantcast
Viewing all articles
Browse latest Browse all 802

Creating a type="fan" densityMap or contMap plot

I have not yet added the "type" argument to functions densityMap or contMap; however it is already possible to create a circular densityMap or contMap style tree. Here's how:

> require(phytools)
Loading required package: phytools
> packageVersion("phytools")
[1] ‘0.2.71’
> # simulate tree & data
> tree<-pbtree(n=100,scale=1)
> x<-fastBM(tree)
> # first plot typical contMap & obtain "contMap" object
> XX<-contMap(tree,x) # we don't care about this one
> # now plot with type="fan"
> plotSimmap(XX$tree,XX$cols,type="fan")
Note: type='fan' is in development. Most options not yet available.
> # finally, add color bar
> # (we have to click where we want this)
> add.color.bar(0.8,cols=XX$cols,title="trait value", lims=range(x),digits=2)

Note that we have to click where we want to put the color bar/legend.

That's it.


Viewing all articles
Browse latest Browse all 802