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

View source: R/ggfocus.R

ggfocusR Documentation

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

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

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

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


Freguglia/ggfocus documentation built on Dec. 5, 2022, 10:05 p.m.