liamrevell/phytools

Custom linking line colors in cophylogeny using association file?

Closed this issue · 1 comments

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)?

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)