How to flip a phylogeny horizontally?

114 Views Asked by At

I have a phylogeny, like this:

library(phytools)
set.seed(30)

phylogeny <- pbtree(n = 26)
phylogeny$tip.label <- LETTERS
plotTree(phylogeny, type = "fan", lwd = .5)

This code gave me the following phylogeny:

enter image description here

Note that the tips went counterclockwise, I need to flip the phylogeny horizontally, making the tips follow clockwise!

I've tried to use rotateNodes(phylogeny, "all") but didn't work.

How can I solve this?

Thanks in advance!

1

There are 1 best solutions below

0
nya On

rotateNodes works if used before plotting.

plotTree(rotateNodes(phylogeny, nodes = "all"), type = "fan", lwd = .5)

enter image description here