Hi David,

David Hembry wrote on 03/12/2012 13:12:
Dear all,

I am plotting associated insect-plant phylogenies with links between
tips using the function cophyloplot, and have two questions about how to
modify the resulting plot.

First, having initially plotted the data successfully, I want to modify
the font size of the tip labels on both the insect and plant phylogenies.

Using the following command:

cophyloplot(glo.tree, epi.tree, file, space = 100, gap = 5, length.line
= 5, lty = 2, cex = 0.5);

where glo.tree and epi.tree are the two phylogenies, and file is the
file indicating associations between tips, I was unable to adjust the
font size from the default. I also tried to change the font size in each
of the input trees before using cophyloplot, to use the tiplabels()
function immediately following cophyloplot(), and to combine both input
trees into a single file using write.tree(append = TRUE). None of these
attempts were successful.

cophyloplot() uses its own "engine" because it must draw two trees on the same plotting region together with the links, so most graphic functions from ape (eg, tiplabels) will not work with it. Also the "..." argument is unused (as specified in the help page). The 'cex' parameter is hard-coded inside the internal function plotCophylo2 so you may edit it, but it's a bit tricky because if you do that the edited version will be in your workspace and it will not be used by cophyloplot() because of ape's namespace. The trick is like this (in case you want to try it, and this might be used in other situations). First make a copy of the internal function:

titi <- plotCophylo2

then do fix(titi) and modify what you want (here look for calls to text(... cex = ...), save and close. Do fix(cophyloplot) and change "plotCophylo2(..." by "titi(...", save and close.

Second, I also tried using the command cophyloplot(use.edge.length =
TRUE) in order to show branch length information (i.e.,
non-time-calibrated trees that result from a likelihood analysis) for
each of the phylogenies, but this had the effect of collapsing the trees
at either side of the figure into trees with miniscule branch lengths,
which were not possible to adjust significantly using the arguments
space, gap, and length.line. Is there a way to show non-calibrated trees
with the function cophyloplot?

Yes, rescale your branch lengths beforehand, eg:

glo.tree$edge.length <- 100 * glo.tree$edge.length
epi.tree$edge.length <- 100 * epi.tree$edge.length

where you have to find the value that best suits your data.



I would be grateful for any suggestions. Thank you very much in advance.

David Hembry

Emmanuel Paradis
IRD, Jakarta, Indonesia

R-sig-phylo mailing list

Reply via email to