[R] add scale bar using add.scale.bar() on the main plot drawn with zoom() of the ape package

Luigi Marongiu marongiu.luigi at gmail.com
Thu Jan 1 19:39:22 CET 2015


Dear all,
I am drawing a phylogenetic tree using the zoom() function of the ape 
package. Since I have 476 sequences in my allagnment, this allows me to 
have the outlook of the main tree and then highlight a portion of it, 
and this works fine.
However I would like to draw a scale bar using add.scale.bar() of ape 
and this function does indeed draw a bar but in the zoomed portion of 
the plot.
The problem is that I don't know if the scale is relative to the main 
tree or to the zoomed portion. Does anybody know?
for reference the script I used is:
   add.scale.bar(
     0,
     -0.5,
     length = 0.1,
     ask = FALSE,
     lwd = 1,
     lcol = "black",
     cex = 0.5
     )

Best regards
Luigi



More information about the R-help mailing list