README.md

Lifecycle: maturing

Installation

Check Devtools

if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")

Install JGPlot2

devtools::install_github("jeffmgranja/jgplot2")

Examples

Main Palettes

Discrete Palette (stallion3)

displayAllColors(jgplot2:::.stallion3[[20]])

Continuous Palette (solarExtra)

displayAllColors(colorRampPalette(jg_palettes()[["solarExtra"]])(10))

stallion3 normal vision

lapply(seq_len(20), function(x){
    displayColors(jgplot2:::.stallion3[[x]]) +
        theme(plot.margin = unit(c(0, 0, 0, 0), "cm")) +
        coord_cartesian(xlim = c(1, 20))
}) %>% Reduce("+", .) %>% {. + plot_layout(ncol=1) +  plot_annotation(title = 'Stallion Version 3 (stallion3)')}

stallion3 deuteranope

lapply(seq_len(20), function(x){
    displayColors(cvdSimulator(jgplot2:::.stallion3[[x]], "deuteranope")) +
        theme(plot.margin = unit(c(0, 0, 0, 0), "cm")) +
        coord_cartesian(xlim = c(1, 20))
}) %>% Reduce("+", .) %>% {. + plot_layout(ncol=1) +  plot_annotation(title = 'Stallion Version 3 (stallion3) : Deuteranope')}

stallion3 protanope

lapply(seq_len(20), function(x){
    displayColors(cvdSimulator(jgplot2:::.stallion3[[x]], "protanope")) +
        theme(plot.margin = unit(c(0, 0, 0, 0), "cm")) +
        coord_cartesian(xlim = c(1, 20))
}) %>% Reduce("+", .) %>% {. + plot_layout(ncol=1) +  plot_annotation(title = 'Stallion Version 3 (stallion3) : Protanope')}



jeffmgranja/jgplot2 documentation built on Nov. 21, 2022, 4:55 a.m.