ggfocus: ggfocus

Description Usage Arguments Value Examples

View source: R/gg-focus.R

Description

ggfocus

Usage

1
2
3
ggfocus(p, var, focus_levels, focus_aes = c("color", "alpha", "fill"),
  color_focus = NULL, color_other = "black", alpha_focus = 1,
  alpha_other = 0.05)

Arguments

p

a ggplot object

var

variable that levels are to be highlighted.

focus_levels

levels to be highlited.

focus_aes

list of aesthetics used to highlight. "color","alpha" and "fill" are available.

color_focus

vector of colors (or a single color) for focused levels.

color_other

color for non-focused levels.

alpha_focus, alpha_other

alpha value for focused and non-focused levels.

Value

a ggplot object with focusing scales.

Examples

1
2
3
library(ggplot2)
p <- ggplot(iris,aes(x=Sepal.Length,y=Petal.Length)) + geom_point()
ggfocus(p, Species, "versicolor")

ggfocus documentation built on May 29, 2018, 5:04 p.m.