Saturday, July 13, 2013

New label plotting in phylomorphospace function

I've been experimenting with a different approach to plotting labels for the tips of the tree in the phytools function phylomorphospace. The latest version uses textxy in the calibrate package. This function moves the labels up and to the right or left, or down and to the right or left, of the label coordinate, depending on the plotting quadrant. This has the effect of tending to move labels away from the center of the plot and reducing clutter.

The alternative that I'm entertaining is to rotate the label to have the orientation of the terminal edge in phylomorphospace. This can be done using base graphics. Below are illustrations of these two basic options:

First - the old labels using textxy:

(Full size.)

Next - the new labels rotated to share the same angle as the terminal edge using R base graphics function text:
(Full size.)

Neither option is perfect - but, personally, I prefer door #2.

(Note that these data show gape width & buccal length in piscivorous vs. non-piscivorous centrarchids. Species names have been abbreviated. The data & tree are courtesy Dave Collar.)

1 comment:

  1. In the current version of phytools, labels can be plotted horizontally or radially - but in the both cases the direction of the label has the same orientation as the terminal edge leading to the label. Neither option uses calibrate:textxy.