ggfocus: (Deprecated) Sets focus scales to an existing 'ggplot' object

Description Usage Arguments Value Author(s) Examples

View source: R/ggfocus.R

Description

'ggfocus()' is deprecated. Add focus scales with 'scale_color_focus()', 'scale_fill_focus()', 'scale_alpha_focus()', ... instead.

Creates a 'ggplot' object with focus scales from another 'ggplot' object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

Sets.

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.

Author(s)

Victor Freguglia

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 Jan. 23, 2020, 5:07 p.m.