# Re: [R-sig-phylo] Graphically comparing multiple trees

```Hello,
Liam, thank You very much! It is what I was looking for. Unfortunately, I have
problem with Your solution 4 and onward (attached). Previous 3 solutions
worked as expected. Some trees were unrooted, rooting did not help. Branch
lengths were variable, but all were ultrametric. Also I don't see why tip
labels are missing.
among trees. I'd like to display support below e.g. 90 in color of respective
tree and some offset not to overlap.```
```
print.phylo(x=hirta[[1]], details=TRUE) # Other trees are similar...

Phylogenetic tree with 28 tips and 27 internal nodes.

Tip labels:
O._engleriana, O._odorata, O._versicolor, O._zeyheri, O._fibrosa,
O._ciliaris, ...
Node labels:
, NA, 100.0, 100.0, 99.0, 100.0, ...

Rooted; includes branch lengths.
## What I did:
# Vertical offset
hirta.ylim <- c(0, Ntip(hirta[[1]])+1)
# Get depths of the tree
hirta.h <- sapply(hirta, function(x) max(nodeHeights(x)))
# Test plot the longest tree to get the maximum x dimension
plotTree(hirta[[which(hirta.h==max(hirta.h))]], direction="leftwards")
hirta.xlim <- get("last_plot.phylo", envir=.PlotPhyloEnv)\$x.lim
# Set tip order based on a majority rule consensus tree
hirta.tips <- setNames(1:Ntip(hirta[[1]]), untangle(consensus(hirta, p=0.5),
# Set colors
hirta.colors <- rainbow(n=length(hirta))
# Plot our trees
for(i in 1:length(hirta)) {
hirta.y.shift <- (i-median(1:length(hirta)))/length(hirta)/2
plotTree(hirta[[i]], color=make.transparent(hirta.colors[i], 0.4),
xlim=hirta.xlim[2:1], mar=c(4.1, 1.1, 1.1, 1.1), nodes="inner",
ftype=if(i==median(1:length(hirta))) "i" else "off", ylim=c(0, 11))
if(i==1) axis(1)
}

Sincerely,
V.

Dne středa 26. dubna 2017 15:29:45 CEST jste napsal(a):
> Hi Vojtech.
>
> I just posted a handful of different possible solutions using phytools
> on my blog:
> http://blog.phytools.org/2017/04/showing-multiple-conflicting.html. Let
> me know if any of them work for you.
>
> All the best, Liam
>
> On 4/25/2017 12:20 PM, Vojtěch Zeisek wrote:
> > Hello,
> > for comparison of two trees I can use very nice function cophyloplot
> > plotting two trees (left and right) and connecting respective nodes by
> > lines. Very nice and convenient to read. But only for two trees.
> > Displaying multiple trees in multiple comparisons is not very convenient.
> > To display dozens to hundreds of trees there is densitree. Also nice, but
> > for this purpose I don't like its display.
> > I have several trees (~5) and I wish to compare their topologies, show
> > supports (at least for differing nodes) and highlight differences. I
> > thought about some overlay/parallel plotting (similar to the attached
> > image) where there would be complete topologies displayed and
> > incongruences would be easily visible. It would be probably doable by
> > plotting all separate trees by plot.phylo and then combining and tuning
> > the figure in some vector editor (like Inkscape). But I hope there is
> > some more automated way to do it. :-) Sincerely,
> > V.
--
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/
```

signature.asc
Description: This is a digitally signed message part.

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