scale_got: Game of Thrones colour scales

scale_gotR Documentation

Game of Thrones colour scales

Description

Uses the Game of Thrones color scale.

Usage

scale_colour_got(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  discrete = FALSE,
  option = "Daenerys"
)

scale_color_got(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  discrete = FALSE,
  option = "Daenerys"
)

scale_fill_got(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  discrete = FALSE,
  option = "Daenerys"
)

scale_colour_got_d(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  option = "Daenerys",
  aesthetics = "colour"
)

scale_color_got_d(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  option = "Daenerys",
  aesthetics = "colour"
)

scale_fill_got_d(
  ...,
  alpha = 1,
  begin = 0,
  end = 1,
  direction = 1,
  option = "Daenerys",
  aesthetics = "fill"
)

Arguments

...

parameters to discrete_scale or scale_fill_gradientn

alpha

pass through parameter to got

begin

The (corrected) hue in ⁠[0,1]⁠ at which the got colormap begins.

end

The (corrected) hue in ⁠[0,1]⁠ at which the got colormap ends.

direction

Sets the order of colors in the scale. If 1, the default, colors are as output by got_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.

Value

A 'ggplot2' scale object (a ggproto object inheriting from Scale) that sets the colours of a plot when added to it with +. The ⁠_d⁠ functions, and the others when discrete = TRUE, return a discrete scale (class ScaleDiscrete) that takes one colour from the palette per data level. The others return a continuous scale (class ScaleContinuous) that maps numeric values onto a gradient of the palette.

Author(s)

Alejandro Jiménez Rico aljrico@gmail.com

Examples

library(ggplot2)

ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) +
geom_bar() +
scale_fill_got(discrete = TRUE, option = "Daenerys")

ggplot(mtcars, aes(factor(gear), fill=factor(carb))) +
geom_bar() +
scale_fill_got(discrete = TRUE, option = "Tully")

ggplot(mtcars, aes(x = mpg, y = disp, colour = hp)) +
geom_point(size = 2) +
scale_colour_got(option = "Lannister")


gameofthrones documentation built on Nov. 26, 2026, 5:08 p.m.