Learn R Programming

GGenemy (version 0.1.0)

gg_simulate_cvd: Simulate Colorblind Vision

Description

Shows how your plot appears to people with different types of color vision deficiency

Usage

gg_simulate_cvd(plot, type = "deutan")

Value

A modified ggplot2 object showing the simulated view

Arguments

plot

A ggplot2 object

type

Type of CVD: "deutan" (green-blind), "protan" (red-blind), or "tritan" (blue-blind)

Examples

Run this code
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
  geom_point() +
  scale_color_manual(values = c("red", "green", "blue"))
gg_simulate_cvd(p, type = "deutan")

Run the code above in your browser using DataLab