liamrevell / phytools

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

Issue/bug with rotateNodes and colouring of tip bars #75

Open Thijmen18 opened 4 years ago

Thijmen18 commented 4 years ago

Hi Liam,

I am currently trying to colour tipbars based on a if statement. Whenever I use the rotateNode function, the length of the bars and the tiplabels are rotated too, but the colouring of the bars does not and does "stick" to the old order. Is this something I can solve or is this a bug in the code? I am using:

mytimetree<-read.newick("mytimetree.tre") hostfam_ranges<-as.matrix(read.csv("host_range.csv",row.names=1))[,1] mytimetree<-rotateNodes(mytimetree,"all") plotTree.barplot(mytimetree,hostfam_ranges,args.barplot=list(col=sapply(hostfam_ranges,function(hostfam_ranges) if(hostfam_ranges<=1) "green" else "yellow")))

Thanks in advance for your help!