GGtree flips my tree
1
0
Entering edit mode
9 months ago
M. ▴ 30

Hi,

I am generating a tree figure with ggtree. But the output keeps coming upside down no matter which parameter I use or change. Does anyone have any idea about this?

This is my command line:

ggtree_obj <- ggtree(species_tree, ladderize = FALSE, layout = "rectangular")+
    theme_tree2(legend.position="none")

Thank you for your help.

ggtree phylogenetics R • 921 views
ADD COMMENT
1
Entering edit mode

Please show your output and an example from the ggtree manual that demonstrates that your tree is indeed upside down.

ADD REPLY
0
Entering edit mode

My output is really big, it contains 2k species. I'm not sure how can I show it from here, but it is completely reversed with the newick format. The first leaf in newick, takes place at the bottom of the tree in ggtree. The topology stays the same. Is there any parameter you know that could solve something like this? I tried to use grid.arrange(p, flip(p, node1, node2) but it didnt worked either.

ADD REPLY
0
Entering edit mode

There has to be something you're able to show to demonstrate that it's flipped. Also, consult the manual - maybe that'll give you a hint on what to expect and where to start if your expectations don't align with ggtree's features.

ADD REPLY
2
Entering edit mode
8 months ago
Beatriz ▴ 20

It is possible to flip/rotate specific branches of your tree with flip.

Command example: https://guangchuangyu.github.io/2015/07/flip-and-rotate-branches-in-ggtree/

Otherwise, You can also try it with the ape::rotate command (it uses R basic plot and not ggplot2)

ADD COMMENT

Login before adding your answer.

Traffic: 1419 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6