See comments below. I hope the instructions are helpful.

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 7/25/2014 1:27 PM, Eliot Miller wrote:
My first problem: I can not set the margins of the plot, because when I use
the adequate label.offset value to fit the symbols between branches and
names, the names of the species are not fit in the plot (the end of the
names are disappear).

Your plotting window should be automatically resized when you increase label.offset, although I'm not sure this is true for all versions of ape. Are you sure you are working with the latest version (i.e., 3.1-4)?

You can also control the plotting dimensions manually. By default, the horizontal (x in a right or left-facing tree) is the total tree length + the label offset + the amount of space required to plot the tip labels; however this can be increased (or decreased) using the argument x.lim. This is also true of the phytools function plotTree, but in that case the analogous arguments are offset and xlim.

My second problem: How can I locate the second set of symbols in the plot?
For only one symbol-type, I used tiplabels(pch = , col = , cex = ). But if
I woud like to put a second set of symbols, how should I put it next to the
first set of the symbols?

To get the x & y coordinates of a plotted tree created using plot.phylo or plotTree, we can steal from inside tiplabels:

lastPP<-get("last_plot.phylo",envir=.PlotPhyloEnv)
x<-lastPP$xx[1:lastPP$Ntip]
y<-lastPP$yy[1:lastPP$Ntip]

Now, we can add points to our plot at coordinates x & y - and if we want to add two sets of points, we can offset the second set by adjusting slightly (for a right or left-facing tree) the x-coordinates. The order of x & y should be the order of bird.families$tip.label.

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to