scale_fill_tintin_d.Rd
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 ggplot2::discrete_scale()
,
ggplot2::continuous_scale()
, or ggplot2::binned_scale()
to control name, limits, breaks,
labels and so forth.
The alpha transparency, a number in [0,1]
, see argument alpha in
hsv
.
The (corrected) hue in [0,1]
at which the color map begins.
The (corrected) hue in [0,1]
at which the color map ends.
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.
A character string indicating the color map option to use. Options are available:
"Tintin in the Land of the Soviets"
"Tintin in the Congo"
"Tintin in America"
"Cigars of the Pharaoh"
"The Blue Lotus" (Standard)
"The Broken Ear"
"The Black Island"
"King Ottokar's Sceptre"
"The Crab with the Golden Claws"
"The Shooting Star"
"The Secret of the Unicorn"
"Red Rackham's Treasure"
"The Seven Crystal Balls"
"Prisoners of the Sun"
"Land of Black Gold"
"Destination Moon"
"Explorers on the Moon"
"The Calculus Affair"
"The Red Sea Sharks"
"Tintin in Tibet"
"The Castafiore Emerald"
"Flight 714 to Sydney"
"Tintin and the Picaros"
"Tintin and Alph-Art"
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")
.
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.
If na.translate = TRUE
, what aesthetic value should the
missing values be displayed as? Does not apply to position scales
where NA
is always placed at the far right.
A function used to create a guide or its name. See
guides()
for more information.
A ggproto
object for use with ggplot2
.
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
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)