-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, we use plotSelectionProb(..., ylimext = 0.2) to make some room for the bar labels in y direction.
It would be convenient if that were automatically determined, but that seems not totally straightforward.
I tried:
- manually calculate the text width using
convertWidth(gropWidth(textGrob(text, gp = gpar(...))))using information fromggplot_build(gg)$data[[2]], and then use that ingg + expand_limits(y), but that seems complicated - use
geom_text_repelinstead ofgeom_text, but that has the same issue, i.e. it constrains the labels to the plotting area
The underlying issue may be that the text dimensions are constant (given the text size and label string), while the axis size depends on the plotting device dimensions, and thus for example the axis expansion in data units would need to be re-calculated when a plot size is changed, while the text size would remain the same.
Maybe there is a more elegant solution?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request