Hi Jacob,

It is possible to call nodelabels() several times to do something similar to what you want by playing with the adj argument which is c(0.5, 0.5) by default (ie, the label is centered on the node). You can try this:

tr <- rcoal(5)
plot(tr, "p", FALSE)
for (h in c(0.4, 0.5, 0.6))
  for (v in c(0.4, 0.5, 0.6))
    nodelabels(pch=15, col=sample(colors(), size=1), cex=2, adj=c(h, v))

The difficulty is to find the 1st and 3rd values of h (horizontal) and v (vertical) and this will depend on the size of the device (and the value of cex of course). Maybe there's a way to automate these calculations.

Best,

Emmanuel

Le 30/08/2018 à 00:12, Jacob Berv a écrit :
Dear R-sig-phylo,

Does there exist a function to plot heatmaps at internal nodes of a tree? For 
example, to illustrate support values from different phylogenetic analyses — ie 
given a set of 3x3 matricies of support values for particular nodes.

It seems like there may be a partial (and definitely workable) solution here, using 
ggtree— https://rgriff23.github.io/2017/05/11/primate-phylogeny-ggtree.html 
<https://rgriff23.github.io/2017/05/11/primate-phylogeny-ggtree.html>, if such 
heatmaps are saved as raster images (about 1/2 way down). This may be the easiest 
solution, but it would be preferable to keep everything in vector format and all in R.

I guess I could do this by calling image() for the individual heatmaps and then 
just linking them up to nodes of interest in illustrator (but that feels like 
cheating).

Jake



        [[alternative HTML version deleted]]

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


Pour nous remonter une erreur de filtrage, veuillez vous rendre ici : 
http://f.security-mail.net/408vx1yEbQu



_______________________________________________
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