| got | R Documentation |
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"
)
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 (0 < alpha < 1) 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 aljrico@gmail.com, 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.