liamrevell / phytools

GNU General Public License v3.0
198 stars 56 forks source link

Custom linking line colors in cophylogeny using association file? #137

Closed myco-bradshaw closed 1 year ago

myco-bradshaw commented 1 year ago

Is it possible to assign custom colors for linking lines directly from an association file?

Ex. Tree1 Tree 2 Color sp1 sp1 #800000 sp2 sp2 #800000 sp3 sp3 #A52A2A

or as a list similar to differing link types (http://blog.phytools.org/2017/10/using-different-link-line-types-widths.html)?

myco-bradshaw commented 1 year ago

Solved:

example

lcol<-rep(make.transparent("blue",0.4),nrow(meta)) lcol[c(6,15,24,25)]<-"#A52A2A" lcol[c(12,27,3,30)]<-"#800000"

plot

plot(Hd2.cophylo,type="pylogram",fsize=0.6,part=0.48, link.type="curved",link.lty="solid",link.lwd=3, link.col=lcol,pts=FALSE)