ggplot2
ggplot2 copied to clipboard
Discard out-of-bounds binned breaks after generating labels
This PR aims to fix #6054.
Briefly, when oob breaks were discarded, atomic labels became out-of-sync. This PR discards such breaks after labels have been retrieved.
Reprex from issue:
devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
data <- data.frame(x = 1:2)
ggplot(data) +
geom_col(aes(x, x, fill = x)) +
scale_fill_steps2(breaks = 1:3, labels = 1:3)

Created on 2024-08-27 with reprex v2.1.1