Highlighting means that alpha value of other levels will be decreased.
Arguments
- p
A
ggplot2
object.- column_name
A character scalar: name of a column in
p
from which levels will be read.- levels
A character vector: levels to highlight.
- alpha_val
A numeric scalar: alpha value to set for levels other than those in
levels
.
Examples
p <- ggplot2::ggplot(
mtcars,
ggplot2::aes(x = cyl, y = mpg, color = factor(am))
) +
ggplot2::geom_point()
highlight_points(p, "am", "0", alpha_val = 0.25)