Open johnnl15 opened 1 year ago
I have the same problem. Can anyone know how to solve this? Thank you very much
I get same issue. Any help will be appreciated.
Same issue here. :)
I am getting the same issue here. Any help would be greatly appreciated. I really like geom_repel_text better than geom_text.
Any help would be greatly appreciated!
Unlike ordinary facetting function, ggbreak
seems to take a different approach to splitting axes, which is incompatible with ggrepel
.
However, you can still use facet_grid()
with space = "free_*"
and scales = "free_*"
to split the plot while preventing the same labels from appearing twice:
p <- ggplot(d, aes(x, y)) +
geom_point() +
geom_blank(data = data.frame(x = Inf, y = c(7, 17))) +
geom_text_repel(aes(label = label)) +
facet_grid(vars(y <= 7), space = "free_y", scales = "free_y") +
theme(strip.background = element_blank(),
strip.text = element_blank())
print(p)
Tips: geom_blank
can sometimes be useful, especially when you want to extend the limit of axes.
Hi, i'm having this issue where the text is printed twice. Would appreciate advice on how to get around this:
require(ggplot2 ) require(ggbreak) require(ggrepel) set.seed(2019-01-19) d <- data.frame( x = 1:20, y = c(rnorm(5) + 4, rnorm(5) + 20, rnorm(5) + 5, rnorm(5) + 22) )
d$label<-"hello" d$label[d$x!=7]<-NA p <- ggplot(d, aes(x, y,label=label)) + geom_point() + geom_text_repel()+ scale_y_break(c(7, 17 )) print(p)