ggplot2 icon indicating copy to clipboard operation
ggplot2 copied to clipboard

Discard out-of-bounds binned breaks after generating labels

Open teunbrand opened this issue 1 year ago • 0 comments

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

teunbrand avatar Aug 27 '24 08:08 teunbrand