-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Scale types overhaul #1526
Comments
@hadley Regarding your last point, ‘different colour scales for fill/colour’: If you’re thinking about the continuous colour scales, I recommend watching this (fascinating!) video about the new default colour scale in matplotlib. (There’s also an R implementation.) |
@huftis yup I'm aware of viridis, and I'm considering making it the default. |
One hacky way of better display for missing values: add_na <- function(x, prop = 0.1) {
x[sample(seq_along(x) <= prop * length(x))] <- NA
x
}
df <- tibble(
x = letters[1:3] %>% sample(100, replace = TRUE) %>% add_na(),
y = rnorm(100) %>% add_na()
)
ggplot(df, aes(x, y)) +
geom_point()
miss <- df %>% filter(is.na(y))
# Jittering and display at one end of the scale is an old idea
# Andreas Buja and was implemented in XGobi/GGobi
ggplot(df, aes(x, y)) +
geom_point(na.rm = TRUE) +
geom_jitter(aes(y = 3.5), data = miss, width = 0.05, height = 0.05, colour = "darkred") +
geom_hline(yintercept = 2.8, size = 10, colour = "white") +
scale_y_continuous(
breaks = c(-2, -1, 0, 1, 2, 3.5),
labels = c(-2, -1, 0, 1, 2, "NA")
) |
Mostly done by @karawoo |
jitter_na()
type for position scales?The text was updated successfully, but these errors were encountered: