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

guide_coloursteps(show.limits = T) produces strange lower limit #5870

Open
davidhodge931 opened this issue Apr 28, 2024 · 1 comment · May be fixed by #5873
Open

guide_coloursteps(show.limits = T) produces strange lower limit #5870

davidhodge931 opened this issue Apr 28, 2024 · 1 comment · May be fixed by #5873
Labels
bug an unexpected problem or unintended behavior guides 📏

Comments

@davidhodge931
Copy link

library(tidyverse)

ggplot(mpg, aes(displ, hwy, colour = hwy)) +
  geom_point() +
  guides(colour = guide_coloursteps(show.limits = T))

Created on 2024-04-29 with reprex v2.1.0

@teunbrand
Copy link
Collaborator

The reason for this is that 10 is an out-of-bounds break that for some reason doesn't get censored.
The scale then assigns a colour for 11 (because (10 + 12) / 2 = 11), which is under the lower limit of 12, so it gets na.value.
Out-of-bounds breaks should probably be removed.

@teunbrand teunbrand added guides 📏 bug an unexpected problem or unintended behavior labels Apr 29, 2024
@teunbrand teunbrand linked a pull request May 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior guides 📏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants