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

"gradient" in geom_hilight does not work properly with coord_flip() or layout_dendrogram() #628

Open
8 tasks done
PandengWang opened this issue Sep 12, 2024 · 0 comments
Open
8 tasks done

Comments

@PandengWang
Copy link

Prerequisites

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

Describe your 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

Thanks so much for developing such a useful package!

The gradient.direction does not work properly when using dendrogram layout. Please see the following example:

tre <- rtree(5)
ggtree(tre) + 
  layout_dendrogram() +
  geom_tiplab(hjust = 0.5, align = T, vjust = 0)  +
  geom_hilight(
         mapping=aes(subset = node %in% 1:5,
                     node = node,
                     fill = label,
                     alpha = 1
                     ),
         type = "gradient",
         to.bottom = T,
         align = "both",
         show.legend = F
     )

or 

ggtree(tre) + 
  geom_tiplab(hjust = 0.5, align = T, vjust = 0)  +
  geom_hilight(
         mapping=aes(subset = node %in% 1:5,
                     node = node,
                     fill = label,
                     alpha = 1
                     ),
         type = "gradient",
         to.bottom = T,
         align = "both",
         show.legend = F
     ) + 
  coord_flip()

Is there a solution to this issue?

Thanks!

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