Hi Ivett.
x.lim & y.lim for type="fan" still work. In this case the standard
dimensions are just +- the total tree length & space for labels, so you
could try (for instance):
h<-max(nodeHeights(tree))
plot(tree,type="fan",no.margin=TRUE,x.lim=1.2*c(-h,h))
and then make further adjustments as necessary.
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://blog.phytools.org
On 7/27/2014 3:40 PM, Ivett Pipoly wrote:
Hi,
thanks a lot for the answers.
I have a few additional information.
I use the type="fan" argument, so my tree is round-shaped, so I can not
exactly set the xlim and ylim...
I.e my tree is: plot.phylo(tree4, type = "fan", cex = 0.6, no.margin =
T, font = 1, use.edge.length = T, label.offset = 0.15). I set the
margins like: par(mar=c(0,0,0,0),oma=c(0,0,0,0)), and I made a .tiff
image with tiff(filename="tree1.tif",width = 18.30, height = 18.30,
units = "cm", res=600)
I tried to do as the advice said but the species names are still not fit
in the picture. I there any arguments to set the size of the topology of
the tree? Or can I set the size of the tree?
PS: My problem with the two lines of symbols is solved, thanks.
Best wishes,
Ivett Pipoly
2014-07-27 17:05 GMT+02:00 Emmanuel Paradis <emmanuel.para...@ird.fr
<mailto:emmanuel.para...@ird.fr>>:
Hi Ivett,
Following Eliot's and Liam's replies, I wish to add a few points.
plot(mytree, no.margin = TRUE) is the same than:
par(mar = rep(0, 4))
plot(mytree)
So the margins are effectively removed and, logically, you cannot
draw something in there.
Liam pointed you in the right direction: you have to manage space
around the tree by setting x.lim with one (more space on the right
of the tree) or two (more space on both sides) values. Note this
option (and y.lim too) manages space around the tree within the plot
region, not in the marings.
The x and y limits of the plot are indeed set by default but this is
much less easy than it may seem. That's why it's always good to play
with x.lim and/or y.lim (also label.offset) to see if the graph may
look better. Besides, if one wants to add graphical elements, the
correct values of these options cannot be found a priori; see
example(phydataplot).
The output depends also on the size of the graphical device you use.
If you are making a figure with lots of elements, it may be worth
writing it directly in PDF of sufficient size, eg:
pdf("mytree.pdf", width = 30, heigth = 20)
plot(mytree, ....
tiplabels(....
....
dev.off()
To draw several series of symbols with tiplabels, you can play with
the option 'adj': there is an example in example(nodelabels).
HTH
Emmanuel
Le 25/07/2014 19:52, Liam J. Revell a écrit :
See comments below. I hope the instructions are helpful.
Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.__revell/
<http://faculty.umb.edu/liam.revell/>
email: liam.rev...@umb.edu <mailto:liam.rev...@umb.edu>
blog: http://blog.phytools.org
On 7/25/2014 1:27 PM, Eliot Miller wrote:
My first problem: I can not set the margins of the plot,
because when
I use
the adequate label.offset value to fit the symbols
between branches and
names, the names of the species are not fit in the plot
(the end of the
names are disappear).
Your plotting window should be automatically resized when you
increase
label.offset, although I'm not sure this is true for all versions of
ape. Are you sure you are working with the latest version (i.e.,
3.1-4)?
You can also control the plotting dimensions manually. By
default, the
horizontal (x in a right or left-facing tree) is the total tree
length +
the label offset + the amount of space required to plot the tip
labels;
however this can be increased (or decreased) using the argument
x.lim.
This is also true of the phytools function plotTree, but in that
case
the analogous arguments are offset and xlim.
My second problem: How can I locate the second set of
symbols in the
plot?
For only one symbol-type, I used tiplabels(pch = , col =
, cex = ).
But if
I woud like to put a second set of symbols, how should I
put it next
to the
first set of the symbols?
To get the x & y coordinates of a plotted tree created using
plot.phylo
or plotTree, we can steal from inside tiplabels:
lastPP<-get("last_plot.phylo",__envir=.PlotPhyloEnv)
x<-lastPP$xx[1:lastPP$Ntip]
y<-lastPP$yy[1:lastPP$Ntip]
Now, we can add points to our plot at coordinates x & y - and if
we want
to add two sets of points, we can offset the second set by adjusting
slightly (for a right or left-facing tree) the x-coordinates.
The order
of x & y should be the order of bird.families$tip.label.
_________________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
<mailto:R-sig-phylo@r-project.org>
https://stat.ethz.ch/mailman/__listinfo/r-sig-phylo
<https://stat.ethz.ch/mailman/listinfo/r-sig-phylo>
Searchable archive at
http://www.mail-archive.com/r-__sig-phylo@r-project.org/
<http://www.mail-archive.com/r-sig-phylo@r-project.org/>
--
*Pipoly Ivett*
Ornithology Research Group
University of Pannonia
Tel.: +36 88 624249
Fax: +36 88 624747
pipoly.iv...@gmail.com <mailto:pipoly.iv...@gmail.com>
+36 20 / 9236407
_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/