Learn R Programming

colorBlindness (version 0.1.6)

cvdPlot: Show color-deficiency simulations of a plot

Description

Plot the color-deficiency simulations for ggplot grob.

Usage

cvdPlot(
  plot = last_plot(),
  layout = c("origin", "deuteranope", "protanope", "desaturate")
)

Arguments

plot

The grob to be plotted.

layout

The sub-figure types. the choices are origin, deuteranope, protanope, desaturate, and enhanced, enhanced.deuteranope, enhanced.protanope, enhanced.desaturate.

Value

An object of ggplot.

Details

This function is modified from <https://github.com/clauswilke/colorblindr>

Examples

Run this code
# NOT RUN {
cvdPlot(displayColors(safeColors))
cvdPlot(displayColors(paletteMartin))
# }

Run the code above in your browser using DataLab