scale_colour_tintin_d | R Documentation |
The tintin
scales provide colour maps for the different Tintin
covers.
scale_colour_tintin_d(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
option = "the_blue_lotus",
aesthetics = "colour"
)
scale_colour_tintin_c(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
option = "the_blue_lotus",
values = NULL,
na.value = "grey50",
guide = "colourbar",
aesthetics = "colour"
)
scale_fill_tintin_d(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
option = "the_blue_lotus",
aesthetics = "fill"
)
scale_fill_tintin_c(
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
option = "the_blue_lotus",
values = NULL,
na.value = "grey50",
guide = "colourbar",
aesthetics = "fill"
)
... |
Other arguments passed on to |
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 color map option to use. Options are available:
|
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 |
values |
if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the colours vector. |
na.value |
If |
guide |
A function used to create a guide or its name. See
|
A ggproto
object for use with ggplot2
.
library(dplyr)
library(ggplot2)
library(tintin)
total_head_trauma <- tintin_head_trauma %>%
arrange(-loss_of_consciousness_length) %>%
filter(row_number() <= 5)
# discrete scale
ggplot(total_head_trauma) +
geom_col(aes(x = cause_of_injury, y = loss_of_consciousness_length,
fill = book_title), position = "dodge") +
labs(x = "Cause of injury", y = "Loss of consciousness length",
title = "Top five causes of injury") +
theme_minimal() +
scale_fill_tintin_d(option = "cigars_of_the_pharaoh", direction = -1) +
coord_flip()
# continuous scale
# continuous scale
ggplot(total_head_trauma) +
geom_col(aes(
x = cause_of_injury, y = loss_of_consciousness_length,
fill = year
), position = "dodge") +
labs(
x = "Cause of injury", y = "Loss of consciousness length",
title = "Top five causes of injury"
) +
theme_minimal() +
scale_fill_tintin_c(option = "cigars_of_the_pharaoh", direction = -1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.