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

geom_inset() does not work with layout_dendrogram() #635

Open
8 tasks done
gernat opened this issue Oct 16, 2024 · 0 comments
Open
8 tasks done

geom_inset() does not work with layout_dendrogram() #635

gernat opened this issue Oct 16, 2024 · 0 comments

Comments

@gernat
Copy link

gernat commented Oct 16, 2024

Prerequisites

  • Have you read Feedback and follow the guide?
    • make sure your are using the latest release version
    • read the documents
    • google your question/issue

Describe you issue

  • Make a reproducible example (e.g. 1)
  • your code should contain comments to describe the problem (e.g. what expected and actually happened?)

Ask in right place

  • for bugs or feature requests, post here (github issue)
  • for questions, please post to google group

Many thanks for developing and maintaining such a useful package! When I try to plot pie charts on top of the nodes of a dendrogram, only one chart is shown. Something similar also happens when I use scale_x_reverse() or scale_y_reverse(), but with coord_flip() I get the expected result.

MRE:

# create a random tree with 5 nodes
library(ggtree)
set.seed(1)
tree <- rtree(3)

# create a pie chart for each node
data <- data.frame(node = 1:5, a = sample(1:100, 5), b = sample(1:100, 5))
pies <- nodepie(data, cols = c("a", "b"))

# Should show a the tree with 5 pie charts, but only one chart is displayed. 
# Works as expected if layout_dendrogram() is removed
ggtree(tree) + layout_dendrogram() + geom_inset(pies)

Result:
ggtree

Any advice on how to deal with this would be great!

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

No branches or pull requests

1 participant