| Title: | Palettes Inspired in the TV Show "Game of Thrones" |
|---|---|
| Description: | Implementation of the characteristic palettes from the TV show "Game of Thrones". |
| Authors: | Alejandro Jimenez Rico [aut, cre] |
| Maintainer: | Alejandro Jimenez Rico <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.3 |
| Built: | 2026-11-26 12:17:03 UTC |
| Source: | https://github.com/cran/gameofthrones |
This function creates a vector of n equally spaced colors along the
'got colour map'.
got(n, alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys") got_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys") gameofthrones( n, alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys" )got(n, alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys") got_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys") gameofthrones( n, alpha = 1, begin = 0, end = 1, direction = 1, option = "Daenerys" )
n |
The number of colors ( |
alpha |
The alpha transparency, a number in |
begin |
The (corrected) hue in |
end |
The (corrected) hue in |
direction |
Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed. |
option |
A character string indicating the colourmap to use. It is not case-sensible |
Here are the color scales:
Semi-transparent colors () are supported only on some
devices: see rgb.
got returns a character vector, cv, of color hex
codes. This can be used either to create a user-defined color palette for
subsequent graphics by palette(cv), a col = specification in
graphics functions or in par.
Alejandro Jiménez Rico [email protected], Personal Blog
library(ggplot2) library(hexbin) dat <- data.frame(x = rnorm(1e4), y = rnorm(1e4)) ggplot(dat, aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_gradientn(colours = got(128, option = "targaryen")) + theme_minimal() pal <- got(256, option = "Wildfire") image(volcano, col = pal)library(ggplot2) library(hexbin) dat <- data.frame(x = rnorm(1e4), y = rnorm(1e4)) ggplot(dat, aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_gradientn(colours = got(128, option = "targaryen")) + theme_minimal() pal <- got(256, option = "Wildfire") image(volcano, col = pal)
Use got to construct palettes of desired length.
got_palettesgot_palettes
An object of class list of length 18.
A dataset containing the colour palettes from the TV show 'Game of Thrones'.
got.mapgot.map
A data frame containing all the colours used in the palette:
V1: Red value
V2: Green value
V3: Blue value
option: Refers to the houses of Westeros, or other colourmaps. It is intended to be a general option for choosing the specific colour palette.
Uses the Game of Thrones color scale.
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" )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" )
... |
parameters to |
alpha |
pass through parameter to |
begin |
The (corrected) hue in |
end |
The (corrected) hue in |
direction |
Sets the order of colors in the scale. If 1, the default, colors
are as output by |
discrete |
generate a discrete palette? (default: |
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 |
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.
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.
Alejandro Jiménez Rico [email protected]
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")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")