theme_deutera: ColourblindR script for deuteranopia

Description Usage Arguments Details Value Examples

View source: R/theme_deutera.R

Description

: theme_deutera() creates a theme with a Deuteranopia friendly colour palette that can be used on both colour and fill aesthetics. Use it in conjuction with ggplot2

Usage

1
: ggplot(data, aes(variable x, variable y, colour = class)) + geom_point() + theme_deutera('colour')

Arguments

colour_type

either fill colour of colour depending on the geom of choice

Details

This function implements a theme that makes plots more intepretable for viewers with deuteranopia. It modifies the colour of geometric objects (points, lines, etc) and the layout of the plot.

: Create your plot via ggplot2 and apply our theme to enhance plots to be more readable for colourblind viewers

Value

reformatted plot for deuteranopia vision

Examples

1
2
3
4
5
## Not run: ggplot(mpg, aes(x = hwy, y = cty, fill = as.factor(cyl))) +geom_bar(stat = 'identity') + theme_deutera(colour_type = 'fill')

## Not run: ggplot(mpg, aes(x = hwy, y = cty, colour = as.factor(cyl))) + geom_point(stat = 'identity')  +  theme_deutera(colour_type = 'colour')

## Not run: ggplot(mpg, aes(hwy, colour = as.factor(cyl))) + geom_density() +  theme_deutera(colour_type = 'colour')

UBC-MDS/ColourblindR documentation built on May 28, 2020, 8:29 p.m.