-
Notifications
You must be signed in to change notification settings - Fork 23
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
Keep colors of unhighlighted #152
Labels
Comments
Thanks, I'll consider if gghighlight can support |
I strongly agree. It is a very useful function to keep the original colors of unhighlighted data, and this would make |
Closed
Now this is possible. Thanks for your suggestion! set.seed(2)
d <- purrr::map_dfr(
letters,
~ data.frame(
idx = 1:400,
value = cumsum(runif(400, -1, 1)),
type = .,
flag = sample(c(TRUE, FALSE), size = 400, replace = TRUE),
stringsAsFactors = FALSE
)
)
# Preserve the colour and modify alpha instead
ggplot(d) +
geom_line(aes(idx, value, colour = type)) +
gghighlight(max(value) > 19,
unhighlighted_params = list(colour = NULL, alpha = 0.3))
#> label_key: type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any way to keep all the colors of the unhighlighted data? I'd like to just reduce their alpha while keeping the colors. I've tried (given that the original aes for color was
my_color_var
:unhighlighted_params = list(alpha = .5, color = aes(my_color_var))
and
unhighlighted_params = list(alpha = .5, color = my_color_var)
The text was updated successfully, but these errors were encountered: