Skip to content

Commit

Permalink
update to plot.cophylo method to permit different font sizes for the …
Browse files Browse the repository at this point in the history
…two trees
  • Loading branch information
liamrevell committed Apr 23, 2016
1 parent 8149928 commit 5072438
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R/cophylo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5072438

Please sign in to comment.