Skip to content

Use na.value in ScaleBinned$map() - #3869

Merged
yutannihilation merged 1 commit into
tidyverse:masterfrom
yutannihilation:fix/issue-3867-binned-scale-na.value
Mar 8, 2020
Merged

yutannihilation merged 1 commit into
tidyverse:masterfrom
yutannihilation:fix/issue-3867-binned-scale-na.value

Conversation

@yutannihilation

Copy link
Copy Markdown
Member

Fix #3867

devtools::load_all("~/repo/ggplot2")
#> Loading ggplot2
library(dplyr, warn.conflicts = FALSE)

df <- tibble(x = rep(1:3, 2), y = rep(1:2, 3), z = 1:6) %>% 
  mutate(z = ifelse(x == 1 & y == 1, NA, z))

p <- ggplot(df, aes(x = x, y = y)) +
  geom_tile(aes(fill = z))

p + scale_fill_viridis_b(na.value = "red")

Created on 2020-03-08 by the reprex package (v0.3.0)

@yutannihilation
yutannihilation merged commit 8dde91a into tidyverse:master Mar 8, 2020
@yutannihilation
yutannihilation deleted the fix/issue-3867-binned-scale-na.value branch March 8, 2020 11:58
sthagen added a commit to sthagen/tidyverse-ggplot2 that referenced this pull request Mar 8, 2020
Use na.value in ScaleBinned$map() (tidyverse#3869)
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.

Binned scales don't use na.value

2 participants