Skip to content

Support for tidy layout - #710

Open
brj1 wants to merge 3 commits into
YuLab-SMU:develfrom
brj1:master
Open

Support for tidy layout#710
brj1 wants to merge 3 commits into
YuLab-SMU:develfrom
brj1:master

Conversation

@brj1

@brj1 brj1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

I came across this tree layout called the "tidy" layout (1, 2) which is a rectangular format that arranges the branches to minimize the vertical displacement. I thought that I would code it up for ggtree. I followed the algorithm in 2.

I don't think it is amazing, but some people might find it useful.

set.seed(0)
tree <- rtree(50)
ggtree(tree)
rect
ggtree(tree, layout = 'tidy')
tidy

@GuangchuangYu

GuangchuangYu commented Jun 30, 2026

Copy link
Copy Markdown
Member

Maybe misleading:

image

@brj1

brj1 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Again, I don't find this layout amazing. I've added a parameter to give the tips some extra padding so that so that the branches don't get squished together too much.

My above example now gives:

tidy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants