Thursday, April 24, 2014

New option to offset tip labels in contMap and densityMap

In response to a recent Facebook request I just added the option to offset tip labels in the phytools functions contMap and densityMap. This is simple. Because plot.contMap and plot.densityMap (the plotting methods for objects returned by each function) use plotSimmap internally, all I had to do was migrate that option to plotSimmap. To get this functionally, users will have to update phytools to a version >=0.4-03 (e.g., here). As of writing, this is not on CRAN.

Here's a quick demo using contMap:

> require(phytools)
Loading required package: phytools
Loading required package: ape
Loading required package: maps
Loading required package: rgl
> packageVersion("phytools")
[1] ‘0.4.3’
> tree<-pbtree(n=40,scale=10)
> x<-fastBM(tree)
> obj<-contMap(tree,x)

OK, now say I'm unhappy with the spacing of my tip labels. I can now do:

> plot(obj,offset=1)

adjusting offset until satisfied. Cool.

Note that although the offset is adjusted, the x-axis limits are not. This could create a problem for a large offset, & I will fix this in future so that xlim is under user control; however, plot.contMap and plot.densityMap already allow a fairly generous space to the right of tip labels anyway.

Finally, this will not work for type="fan". This is the same as in plotSimmap, so addressing this will take a little more effort than I'm willing to invest at this precise moment in time.

2 comments:

  1. Students are studying well in India when we compare to other countries. From the school days, the students are giving more important for the studies. So when they use to join college they had already prepared well for the college life. Many colleges like presidency in India are providing best courses like mba, mca, msc, etc. Nowadays the parents no need to select the college for their childrens. Because they are more active childrens, selecting by their own.Students are selecting top colleges in various cities in India like chennai, bangalore, kolkata and mumbai.

    ReplyDelete
  2. The offset printing method makes use of the CMYK color space that produces a wide array of colors in which you can use in your prints. These colors are crisp and vibrant bringing life to any image that you print.Inti Prima Karya

    ReplyDelete