Hi Cacau.

It depends what exactly you're going for. For instance, you can plot trees that face each other using cophylo.plot in the ape package; however, if you don't need links connecting tips in each tree, then you could use par(mfrow) or layout instead.

For example:

require(phytools)
par(mfrow=c(1,2))
plotTree(tree)
plotTree(tree,direction="leftwards")

This will repeat the labels twice. If you don't want to do this, you could try:

layout(matrix(1:3,1,3),widths=c(0.48,0.04,0.48))
## adjust widths depending on the size of your tip
## labels
plotTree(tree,ftype="off")
plot.new(); plot.window(xlim=c(-1,1),ylim=c(1,length(tree$tip.label)))
par(cex=1)
text(rep(0,length(tree$tip.label)),1:length(tree$tip.label),tree$tip.label)
plotTree(tree,ftype="off",direction="leftwards")

Obviously, at each step you can use functions like nodelabels() etc. to add features to the two plotted trees.

If you decide to use phytools, you should probably first install the latest (non-CRAN) version (http://www.phytools.org/nonstatic or http://www.phytools.org/nonstatic/bin for binaries).

Let us know if this helps you get started.

- Liam

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 9/8/2013 5:01 PM, Cacau Centurion wrote:
Hi,

I am thinking about building a mirror tree like the one shown as
follows. Does anybody know how I should do it? Thanks!

内嵌图片 1


Cacau


_______________________________________________
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/


_______________________________________________
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