Learn R Programming

thewitcher (version 1.0.1)

scale_color_witcher: The Witcher colour scales

Description

Uses the The Witcher color scale.

Usage

scale_color_witcher(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  discrete = FALSE,
  option = "Geralt"
)

scale_colour_witcher( ..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE, option = "Geralt" )

scale_colour_witcher_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "Geralt", aesthetics = "colour" )

scale_color_witcher_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "Geralt", aesthetics = "colour" )

scale_fill_witcher( ..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE, option = "Geralt" )

scale_fill_witcher_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "Geralt", aesthetics = "fill" )

Arguments

...

parameters to discrete_scale or scale_fill_gradientn

alpha

pass through parameter to witcher

begin

The (corrected) hue in from 0 to 1 at which the witcher colormap begins.

end

The (corrected) hue in from 0 to 1 at which the witcher colormap ends.

direction

Sets the order of colors in the scale. If 1, the default, colors are as output by witcher_pal. If -1, the order of colors is reversed.

discrete

generate a discrete palette? (default: FALSE - generate continuous palette)

option

A character string indicating the colourmap to use.

aesthetics

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the colour and fill aesthetics at the same time, via aesthetics = c("colour", "fill"). Parameter inherited from 'ggplot2'.

Details

For discrete == FALSE (the default) all other arguments are as to scale_fill_gradientn or scale_color_gradientn. Otherwise the function will return a discrete_scale with the plot-computed number of colors.

Examples

Run this code
# NOT RUN {
library(ggplot2)
ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) +
geom_hex() + coord_fixed() +
scale_fill_witcher(option="ciri") + theme_bw()

ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) +
geom_hex() + coord_fixed() +
scale_fill_witcher(option="geralt") + theme_bw()


# }

Run the code above in your browser using DataLab