Closed as duplicate of#5609
Description
It'd be nice to be able to nudge in a proportional way easily. At present, you can calculate your nudge manually in absolute units, but it'd nice if there was a more simple straightforward way.
The I
function allows relative positioning when annotating. So was wondering if it'd be possible to support this with nudging? This is adding nudge_x =I(0.05)
or position_nudge(x = I(0.05))
to do this, rather than having to manually calculate.
Sorry for all the issues!
library(tidyverse)
library(tidyplots)
#currrently do this
spendings |>
group_by(category) |>
summarise(across(amount, sum)) |>
ggplot(aes(x = amount, y = category, label = amount)) +
geom_col() +
geom_text(nudge_x = 1200 * 0.05) #guessing 1200 is the size of the x scale
# # would like to do this
# spendings |>
# group_by(category) |>
# summarise(across(amount, sum)) |>
# ggplot(aes(x = amount, y = category, label = amount)) +
# geom_col() +
# geom_text(nudge_x = I(0.05))
Created on 2025-05-21 with reprex v2.1.1
Metadata
Metadata
Assignees
Labels
No labels