Permalink
Browse files

small update to plot.cophylo to permit

user control of tip linking lines
  • Loading branch information...
liamrevell committed Apr 13, 2018
1 parent 9ddeead commit 67f4704a551ebc0d025677e6eae69b1f03997a1b
Showing with 3 additions and 1 deletion.
  1. +3 −1 R/cophylo.R
View
@@ -120,6 +120,8 @@ phylogram<-function(tree,part=1,direction="rightwards",fsize=1,ftype="i",lwd=1,.
else tip.lwd<-1
if(hasArg(tip.lty)) tip.lty<-list(...)$tip.lty
else tip.lty<-"dotted"
if(hasArg(tip.len)) tip.len<-list(...)$tip.len
else tip.len<-0.1
d<-if(direction=="rightwards") 1 else -1
## sub "_" for " "
tree$tip.label<-gsub("_"," ",tree$tip.label)
@@ -163,7 +165,7 @@ phylogram<-function(tree,part=1,direction="rightwards",fsize=1,ftype="i",lwd=1,.
x1=d*xx[2:length(xx)],y1=yy[2:length(yy)],lwd=lwd,lend=2,col=edge.col[ee])
}
## plot links to tips
h<-max(X)+0.1*(max(X)-min(X))+max(fsize*strwidth(tree$tip.label))-
h<-max(X)+tip.len*(max(X)-min(X))+max(fsize*strwidth(tree$tip.label))-
fsize*strwidth(tree$tip.label)
for(i in 1:n){
lines(d*c(X[which(cw$edge[,2]==i),2],h[i]),rep(y[i],2),lwd=tip.lwd,lty=tip.lty)

0 comments on commit 67f4704

Please sign in to comment.