-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Labels
Milestone
Description
I found a problem when updating the package to 4.0.0 in one of my visualizations. In a column chart, the labels produced by geom_text()
used position = position_stack(vjust = 0.5)
to center in the middle of the bars. The argument is now getting ignored.
Here is the code to reproduce the bug:
``` r
library(ggplot2)
test <- tibble::tibble(bin = seq(3), count = c(23,22,10))
ggplot(test, aes(x = bin, y = count))+
geom_col(position = 'dodge',
width=0.99,
fill = '#DC9542',
alpha = 0.85)+
theme_minimal()+
geom_text(
aes(label = round(count, 2), y = count + 1),
position = position_stack(vjust = 0)
)
ggplot(test, aes(x = bin, y = count))+
geom_col(position = 'dodge',
width=0.99,
fill = '#DC9542',
alpha = 0.85)+
theme_minimal()+
geom_text(
aes(label = round(count, 2), y = count + 1),
position = position_stack(vjust = 1)
)
ggplot(test, aes(x = bin, y = count))+
geom_col(position = 'dodge',
width=0.99,
fill = '#DC9542',
alpha = 0.85)+
theme_minimal()+
geom_text(
aes(label = round(count, 2), y = count + 1),
position = position_stack(vjust = 0.5)
)
Created on 2025-10-09 with reprex v2.1.1