ggtree
ggtree copied to clipboard
Request to add roundrect.r option to layout.params
trafficstars
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
It would be very useful to be able to modify the curvature of the tree when using the roundrect layout. For example to add just a little bit of curvature but not as much as is the default. Perhaps by modifying a roundrect.r layout parameter similar to what is available in geom_hilight. Please forgive me if this is already possible, I was unable to find any method after looking through the issues, discussion, google group, or code.
you can use shape argument (default is 0.5, should be a numeric vector of values between -1 and 1) to control the radius of the rounded corners when layout='roundrect'.
for example
library(ggtree)
set.seet(123)
tree <- rtree(10)
p1 <- tree |> ggtree(layout='roundrect')
p2 <- tree |> ggtree(layout='roundrect', shape=.25)