An anonymous user request was recently made to add the potential to control the axis dimensions in phenogram. I guessed (correctly) that this would not be too hard, and so I have added this capability to the newest version of the function (direct link to code here).
To accomplish this, I have just added one additional argument:
function (tree, x, fsize = 1, ftype = "reg", colors = NULL, axes = list())
This is specified as a list containing two components: trait and time. The former should be a vector of length 2 specifying the dimensions of the vertical (trait) axis; and the latter a vector of length 2 giving the desired dimensions on the horizontal (time since the root) axis.
Within the function itself, I have now added the following lines of code (before calling plot.window to create the graph):
This code just uses the vectors provide in axes to specify the dimensions in x & y for the plot - or, if none have been provided, it uses the range of x and nodeHeights(tree) (plus a little bit of extra space to print tip labels).
Let's see how it works:
> phenogram(tree,x) # default settings
> phenogram(tree,x,axes=list(trait=c(-2,2))) # change vertical
> # change horizontal
> phenogram(tree,x,axes=list(trait=c(-2,2), time=c(1.5,max(nodeHeights(tree)))))
It also works with a mapped discrete character. For instance:
> cols<-c("blue","red"); names(cols)<-c(1,2)