Permalink
Browse files

update to plot.cophylo method to permit different font sizes for the …

…two trees
  • Loading branch information...
liamrevell committed Apr 23, 2016
1 parent 8149928 commit 5072438f2a77fc0024c5afcd31309f507c2f79a2
Showing with 9 additions and 4 deletions.
  1. +9 −4 R/cophylo.R
View
@@ -124,13 +124,18 @@ plot.cophylo<-function(x,...){
else scale.bar<-rep(0,2)
if(hasArg(ylim)) ylim<-list(...)$ylim
else ylim<-if(any(scale.bar>0)) c(-0.1,1) else c(0,1)
if(hasArg(fsize)) fsize<-list(...)$fsize
else fsize<-1
obj<-list(...)
par(mar=mar)
plot.window(xlim=xlim,ylim=ylim)
x1<-phylogram(x$trees[[1]],part=0.4,...)
leftArgs<-rightArgs<-obj
if(!is.null(obj$fsize)&&length(obj$fsize)>1){
leftArgs$fsize<-obj$fsize[1]
rightArgs$fsize<-obj$fsize[2]
}
x1<-do.call("phylogram",c(list(tree=x$trees[[1]],part=0.4),leftArgs))
left<-get("last_plot.phylo",envir=.PlotPhyloEnv)
x2<-phylogram(x$trees[[2]],part=0.4,direction="leftwards",...)
x2<-do.call("phylogram",c(list(tree=x$trees[[2]],part=0.4,
direction="leftwards"),rightArgs))
right<-get("last_plot.phylo",envir=.PlotPhyloEnv)
if(!is.null(x$assoc)) makelinks(x,c(x1,x2))
else cat("No associations provided.\n")

0 comments on commit 5072438

Please sign in to comment.