Repository navigation
Fix linetype regression - #6097
Conversation
|
Looks good! I think this should be documented in p + scale_linetype_manual(values = 1:5, na.value = "dotted") |
|
I'm happy to add a news bullet. I'm not sure I agree it is a breaking change. In 3.5.1, using a numeric palette with character library(ggplot2)
df <- economics_long
df$variable[100:105] <- NA
ggplot(df, aes(date, value01, linetype = variable)) +
geom_line() +
scale_linetype_manual(values = 1:5, na.value = "blank")
#> Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow): invalid line type: must be length 2, 4, 6 or 8Created on 2024-09-16 with reprex v2.1.1 |
Aw, got it. Sorry, I didn't notice this difference and tried with a data without actual |
|
Thanks for the review! |
This PR aims to fix #6096.
Briefly, it replaces
na.value = "blank", which casts mapped value to characters, tona.value = NA, which will castNAto whatever type mapped values have.