cvd_sim: Make combined figure of color-vision deficiency simulations

Description Usage Arguments Examples

View source: R/cvd_sim.R

Description

The function cvd_sim() shows the original figure and three color-blind simulated versions. The function cvd_sim2() only shows the color-blind simulated versions and adds a desaturated version also.

Usage

1
2
3
4
5
6
7
cvd_sim(p, severity = 1, scale = 0.9, hjust = 0, vjust = 1,
  label_x = 0, label_y = 1, label_size = 14,
  label_fontface = "plain")

cvd_sim2(p, severity = 1, scale = 0.9, hjust = 0, vjust = 1,
  label_x = 0, label_y = 1, label_size = 14,
  label_fontface = "plain")

Arguments

p

The figure on which to perform the simulation

severity

The severity of the simulation

scale

The scale reduction of the figures

hjust, vjust

Label justification

label_x, label_y

The x and y position of the labels relative to each figure

label_size

The size of the labels

label_fontface

The fontface of the labels

Examples

1
2
3
4
5
6
7
viridis_scale <- gg_color_gradient(
  plot_margin = margin(12, 0, 0, 0),
  ymargin = 0.05
) + scale_fill_viridis_c()

cvd_sim(viridis_scale)
cvd_sim2(viridis_scale)

clauswilke/dviz.supp documentation built on Aug. 25, 2020, 2:12 a.m.