Hi Gwennael.
I'm not totally sure I understand the problem, but this might help.
You can use windows (in Windows) or dev.new to creating a plotting
window with you desired dimensions. plot.phylo will then automatically
rescale the branch lengths to fit. You can also control the font size
from within plot.phylo.
For example:
library(ape)
dev.new(width=2,height=10)
plot(tree,cex=0.2,no.margin=T)
savePlot("test1.pdf",type="pdf")
# or, using phytools plotTree, which gets rid of some of the excess
# whitespace
library(phytools)
dev.new(width=2,height=10)
tree<-compute.brlen(tree) # since your tree has no edge lengths
plotTree(tree,fsize=0.2,ftype="i",lwd=0.4,pts=F)
savePlot("test2.pdf",type="pdf")
In addition, in an interactive session the tree (but not the labels)
will automatically resize when you manually resize the plotting window.
Is this at all helpful?
All the best, Liam
Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com
On 8/28/2012 1:34 PM, Gwennaël Bataille wrote:
Dear R-sig-phylo users,
I would like to rescale a large tree, but I am not an expert of graphs
in R...
My labels overlap with each other. And I would like to find an option to
put more space between each branch, but could not find one.
So I tried to resize the labels (playing with cex parameter), but now
the branches are far too long in comparison with the labels... So I
would like to reduce also branch lengths :
- I can define new values for "edge.length" but I want my taxa to be
aligned. So, I prefer "use.edge.length=F"
- I also thought about playing with "x.lim" parameter, but my graph is
then truncated rather than resized...
Any help would be appreciated.
Thanks a lot in advance,
Gwennaël ( gwennael.batai...@uclouvain.be
<mailto:gwennael.batai...@uclouvain.be> )
PS: Here are the script and the data :
#Question r-sig-phylo
library(ape)
t <-
"(1,((((2,3),(18,19,20,21,22,23,24,25,26,27,28,29,30,31)),(4,5),(6,7,8),(9,10,11,12,13,14),(15,16,17),((32,33),34,((35,36,37),38,39))),((((40,42),41),(43,(44,45,46),47,((48,49),50))),((((51,52,53,54),(((55,((56,(57,58)),(59,60),61)),((62,63),64,65)),((66,67,68,69,70,71,72),73,(74,75,76,77)))),((((((78,(80,82)),(84,87)),((79,(81,83)),89)),(85,86)),88),(90,91,92))),((93,((94,95),((96,97,98,99,100,101,102,103,104,105,106),(118,(119,120),121,122,(123,124,125,126,127,128),129,(((130,131,132,133,134,135),136,138,139,((141,142),((143,144),(145,(146,147))))),137,140,(148,149,150,151),(152,153,154,155,156,157,158,159,160),((161,(164,165,166),((172,((173,177),(178,183)),179,180,181,182,184),174,175,176,185,186,187,188)),(167,168,169,170,171)),162,163))),((107,108),109,((110,111,112,113,114,115),(116,117))))),(((189,(((((((256,257,258,259,260,261,262),((((263,279),((268,269,271),270,272,(273,276),274,275,277,278)),(264,265,266,267)),(280,281,282,283,284,285),((286,287,288,289),(291,292!
),(293
,294)),290)),((((342,343),(344,345,346)),349),(347,348))),295,((296,301),297,298,299,300,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,(((324,325,327,328),326),329),330,331,332,333,334,335,336,337,338,339,340,341)),(350,351,352,353,354,355,356,357,358,359,360,361,362,363)),364),(365,366),(367,368,369),370)),(((191,192,193),(((((((199,201),200),(202,(207,208))),(203,204)),(205,206)),209),((((((236,237),(242,(((243,247),244),(245,(246,248)),249))),240),238,239),241),((((250,253),255),254),(251,252))))),(((194,195,196),(197,198)),(((((210,211),212),213,(214,(215,216))),(228,(229,230))),((217,((218,221),(219,220),222,223,224,225,226,227)),((((231,234),233),232),235)))))),190))))));"
tree <- read.tree(text=t)
plot(tree)
#Plot with reduced size of the labels
windows(width=15, height=10, pointsize=10, rescale="fixed")
par(xpd=NA, cex = 0.3) #Reduce size of the labels
plot(tree, y.lim=c(0,400))
#Play with x.lim
plot(tree, y.lim=c(0,400), x.lim=200)
#Define new edge length
tree2 <- tree$edge.length <- rep.int(5,544)
plot(tree2, y.lim=c(0,400), x.lim=200, use.edge.length=T)
[[alternative HTML version deleted]]
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo