Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add offset.label and label to geom_treescale #360

Merged
merged 2 commits into from Dec 23, 2020

Conversation

xiangpin
Copy link
Member

add offset.label and label to geom_treescale, these parameters will control the title of tree scale. offset.label represents the distance between line and title of tree scale. #359

for example

library(ggtree)
library(ggplot2)
library(patchwork)

set.seed(2020)
x = rtree(5)

p1 <- ggtree(x) + geom_treescale(x=2, y=1, offset=.1, offset.label=-0.2, label="substitution rate")

p2 <- ggtree(x) + geom_treescale(x=2, y=1, offset=-.2, offset.label=0.1,label="substitution rate")

p <- p1 + p2
p

treescale_fig

I had tried convert x and y to npc unit, and the width should be keeped native unit. But it can not create data.frame to plot tree scale. I think if we want to convert x and y to npc unit, we might need to create treescaleGrob.

@GuangchuangYu GuangchuangYu merged commit b6dd41a into YuLab-SMU:master Dec 23, 2020
@GuangchuangYu
Copy link
Member

the unit parameter is not in high priority. Let's postpone to do it.

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.

None yet

2 participants