Overview

Installation

# install.packages("devtools")
devtools::install_github("dylan-stark/ggfocus")

Usage

Just add a scale_colour_focus() call to your plots at set the position (pos) argument to the position in the color scale that you want to emphasize. The selected position will retain it’s color while all other positions will map to gray scale. Here’s an example:

library(ggplot2)
library(ggfocus)

p3 <- ggplot(economics_long, aes(date, value01, colour = variable)) +
  geom_line()

p3

Check out the package vignette (vignette("ggfocus")) for more examples.