Skip to contents

Highlighting means that alpha value of other levels will be decreased.

Usage

highlight_points(p, column_name, levels, alpha_val = 0.1)

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.

Value

A ggplot2 object.

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)