Reverse x-axis in units of time

897 views
Skip to first unread message

Bjørn Tore Kopperud

unread,
Jun 13, 2017, 11:03:42 AM6/13/17
to ggtree
Hello,

Sorry if this has been asked before, I could not manage to find a solution through the vignettes or searches. Say I have a tree in R,


tree <- rcoal(20)

ggtree(tree) +
  geom_tree() +
  geom_tiplab(size=rel(3)) +
  theme_tree2()

With this plot, the x-axis starts with zero at the root of the tree. I want to reverse the x-axis such that the zero is at the time of the extant species, and positive values of time at the internal branches. I do NOT want to reverse the plot, only the values of the x-axis.

In other words, this
scale_x_reverse()
is not what I want.

Thanks for help,
Bjørn

Yu, Guangchuang

unread,
Jun 18, 2017, 11:13:09 PM6/18/17
to Bjørn Tore Kopperud, ggtree

--
G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
 
Homepage: https://guangchuangyu.github.io/ggtree
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/3cbf56b9-c905-44e2-a98f-e3d47e1fd98e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--~--~---------~--~----~------------~-------~--~----~
Guangchuang Yu, PhD Candidate
State Key Laboratory of Emerging Infectious Diseases
School of Public Health
The University of Hong Kong
Hong Kong SAR, China
-~----------~----~----~----~------~----~------~--~---
Reply all
Reply to author
Forward
0 new messages