Open
Description
I am having issues labeling a paraphyletic clade using geom_strip. I want to have the label of the clade rotate with the position of the strip, as is possible in geom_cladelab by using angle = "auto". This is supposed to be possible in geom_strip also, but currently produces an error message.
Reproducible Example
library(ggplot2)
library(ggtree)
tree = rtree(10, rooted = TRUE, tip.label = C(1:10))
test = ggtree(tree, layout = "circular", branch.length = "none",
ladderize = TRUE, size = .8) +
theme(legend.position = c(0, .82),
legend.text = element_text(size = 8),
legend.title = element_text(size = 8)) +
theme(plot.margin=unit(c(.1,1.5,.1,0),"cm")) +
geom_strip(1, 2, label = "Test Label", color = "red", angle = "auto",
horizontal = FALSE, barsize = 2, offset.text = 1.75, hjust = .5, offset = 2, fontsize = 5)
test
test2 = ggtree(tree, layout = "circular", branch.length = "none",
ladderize = TRUE, size = .8) +
theme(legend.position = c(0, .82),
legend.text = element_text(size = 8),
legend.title = element_text(size = 8)) +
theme(plot.margin=unit(c(.1,1.5,.1,0),"cm")) +
geom_strip(1, 2, label = "Test Label", color = "red",
horizontal = FALSE, barsize = 2, offset.text = 1.75, hjust = .5, offset = 2, fontsize = 5)
test2
The object test2 produces a normal phylogeny with a labeled clade (paraphyletic or otherwise), however the object test produces the following error message:
Error in `geom_text()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 4th layer.
Caused by error in `validDetails.text()`:
! invalid 'rot' value
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In validDetails.text(x) : NAs introduced by coercion
This can be fixed in post if necessary, but ideally I would like this to be fixed during the initial object production.
Metadata
Metadata
Assignees
Labels
No labels