Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero-range limits in binned scale #5074

Merged
merged 4 commits into from
Jan 6, 2023

Conversation

teunbrand
Copy link
Collaborator

This PR is intended as a partial fix to #5066. In brief, the map() method circumvents cut() when there aren't enough breaks for that function. It resolves the error in #5066, but does not resolve the guide_coloursteps() issue (because that guide is in reconstruction). In choosing a palette-value for zero-range limits, it now behaves similar to scale_fill_continuous().

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2
library(patchwork)

a <- data.frame(x = c("a", "b"), 
           y = c("A", "B")) |> 
  ggplot() + 
  geom_bin_2d(aes(x = x, y = y))

b <- a + scale_fill_binned()

a + b

Created on 2022-12-01 by the reprex package (v2.0.1)

@teunbrand teunbrand added this to the ggplot2 3.4.1 milestone Jan 5, 2023
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit bfe4b1c into tidyverse:main Jan 6, 2023
@teunbrand teunbrand deleted the binned_zerorange branch January 6, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants