You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
geom_text_repel(..., point.padding = NA) can be used to avoid text being repelled by other data points. I need this feature because I want to use ggrepel to annotate inside a bar plot, so the text must not be repelled by the bars.
However, if I use geom_label_repel instead in this way, the following error is produced:
Error in convertUnit(x, unitTo, "x", "dimension", "x", "dimension", valueOnly = valueOnly) :
'x' argument must be a unit object
Here is an image of the output produced by the code:
However, this does not work with geom_label_repel:
ggplot(t, aes(x = Env, y = nGt, fill = nRpl)) + geom_col() +
geom_label_repel(aes(y = lPos, label = nRpl), point.padding = NA)
## Error in convertUnit(x, unitTo, "x", "dimension", "x", "dimension", valueOnly = valueOnly) :
## 'x' argument must be a unit object
Suggestions
It would be nice if geom_label_repel could also ignore other non-text geoms like is the case for geom_text_repel, for example if there are contrast issues between text and underlying graphics.
Summary
geom_text_repel(..., point.padding = NA)
can be used to avoid text being repelled by other data points. I need this feature because I want to use ggrepel to annotate inside a bar plot, so the text must not be repelled by the bars.However, if I use
geom_label_repel
instead in this way, the following error is produced:Since Issue #79 / PR #80 it is possible to use
Minimal code example
Here is the minimum amount of code neeeded to demonstrate the issue:
Here is an image of the output produced by the code:
However, this does not work with
geom_label_repel
:Suggestions
It would be nice if
geom_label_repel
could also ignore other non-text geoms like is the case forgeom_text_repel
, for example if there are contrast issues between text and underlying graphics.A similar topic was issue #79.
Version information
Here is the output from
sessionInfo()
in my R session:The text was updated successfully, but these errors were encountered: