Title: | Collection of Palettes, Themes, and Theme Components |
---|---|
Description: | A collection of palettes, themes, and theme components based on publicly available branding guidelines of various non-governmental organisations, government agencies, and United Nations units. |
Authors: | Ernest Guevarra [aut, cre] |
Maintainer: | Ernest Guevarra <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.0.9001 |
Built: | 2024-10-26 02:55:04 UTC |
Source: | https://github.com/katilingban/paleta |
The function will search the system for availability of any of the Africa
CDC fonts in heirarchical order starting with Acumin Pro, then
Brandon Text, then Calibri, and then finally Arial. If none of these
are found in the system, the function will return Noto Sans by default or
the user can set which font to use as alternative by specifying alt
.
acdc_fonts set_acdc_font(alt = paleta_fonts$paleta_noto)
acdc_fonts set_acdc_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the Africa CDC fonts are not available in the system. |
An object of class list
of length 4.
A character value for font family to use as Africa CDC font.
acdc_fonts set_acdc_font()
acdc_fonts set_acdc_font()
Africa CDC colours
acdc_green acdc_gold acdc_black acdc_brown acdc_yellow acdc_orange acdc_red acdc_dark_green
acdc_green acdc_gold acdc_black acdc_brown acdc_yellow acdc_orange acdc_red acdc_dark_green
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
acdc_green acdc_gold acdc_brown
acdc_green acdc_gold acdc_brown
Africa CDC palettes
acdc_palettes
acdc_palettes
An object of class list
of length 15.
acdc_palettes
acdc_palettes
Get named colours vector
get_colour( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE ) get_colours( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE )
get_colour( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE ) get_colours( pattern = NULL, model = c("hex", "rgb", "cmyk", "pantone"), named = FALSE )
pattern |
Optional. A character value or vector to use as a search term. Default is NULL in which case all the Oxford colours are returned. |
model |
A character vector of colour model. Can be "rgb", "cmyk", "hex", or "pantone". Default is "hex". |
named |
Logical. Should the output be a named character value or vector? Default is FALSE. |
A character value or vector of colour/s as per model
specification.
If named
is TRUE, returns a named character value or vector.
get_colours() get_colours(model = "rgb") get_colours(pattern = "orange") get_colours(pattern = c("orange", "brown"), named = TRUE) get_colours(pattern = c("orange", "GREEN", "Blue"))
get_colours() get_colours(model = "rgb") get_colours(pattern = "orange") get_colours(pattern = c("orange", "brown"), named = TRUE) get_colours(pattern = c("orange", "GREEN", "Blue"))
NHS colours
nhs_blue nhs_white nhs_dark_blue nhs_bright_blue nhs_light_blue nhs_aqua_blue nhs_black nhs_dark_grey nhs_mid_grey nhs_pale_grey nhs_dark_green nhs_green nhs_light_green nhs_aqua_green nhs_purple nhs_dark_pink nhs_pink nhs_dark_red nhs_orange nhs_warm_yellow nhs_yellow
nhs_blue nhs_white nhs_dark_blue nhs_bright_blue nhs_light_blue nhs_aqua_blue nhs_black nhs_dark_grey nhs_mid_grey nhs_pale_grey nhs_dark_green nhs_green nhs_light_green nhs_aqua_green nhs_purple nhs_dark_pink nhs_pink nhs_dark_red nhs_orange nhs_warm_yellow nhs_yellow
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
nhs_blue nhs_dark_blue
nhs_blue nhs_dark_blue
The function will search the system for availability of any of the NHS
fonts in heirarchical order starting with Andes, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt
.
nhs_fonts set_nhs_font(alt = paleta_fonts$paleta_noto)
nhs_fonts set_nhs_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the NHS fonts are not available in the system. |
An object of class list
of length 2.
A character value for font family to use as NHS font.
nhs_fonts set_nhs_font()
nhs_fonts set_nhs_font()
NHS palettes
nhs_palettes
nhs_palettes
An object of class list
of length 25.
nhs_palettes
nhs_palettes
Colours based on visual identity guidelines of various organisations
paleta_colours
paleta_colours
A tibble with 5 fields
Variable | Description |
name | Organisation colour name |
code | Organisation colour code |
rgb | Three integers for the red, green, blue components of the RGB colour model |
cmyk | Four integers for the cyan, magenta, yellow, and black components of the CMYK colour model |
hex | Hexadecimal codes for corresponding colour |
pantone | Pantone colour name |
paleta_colours
paleta_colours
Base package fonts
paleta_fonts
paleta_fonts
An object of class list
of length 3.
paleta_fonts
paleta_fonts
Print function for palettes
## S3 method for class 'palette' print(x, ...)
## S3 method for class 'palette' print(x, ...)
x |
An object of class |
... |
Additional arguments to print |
The function will search the system for availability of any of the paleta fonts in heirarchical order starting with Roboto Condensed, then Noto Sans, and then Roboto.
set_paleta_font()
set_paleta_font()
A character value for font family to use as paleta font.
set_paleta_font()
set_paleta_font()
Get shade of colours
shade_colour(hex, p) shade_colours_(hex, p) shade_colours(hex, p, label = FALSE)
shade_colour(hex, p) shade_colours_(hex, p) shade_colours(hex, p, label = FALSE)
hex |
A character value or vector of character of values for hex code of colour/s to shade. |
p |
Range from 0 to 1 for proportion to shade the colour/s with. |
label |
Logical. Should the output/s be labelled? Default is FALSE. |
A character value or vector of character values of hex code/s shaded to the desired proportion.
shade_colour(acdc_green, p = 0.2) shade_colours(acdc_palettes$acdc_secondary, p = 0.4)
shade_colour(acdc_green, p = 0.2) shade_colours(acdc_palettes$acdc_secondary, p = 0.4)
These are wrappers for theme_paleta()
that use colours and fonts from the
Africa CDC visual identity guidelines.
theme_acdc_light( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_green, subtitle_family = base_family, subtitle_colour = acdc_gold, caption_colour = acdc_gold, axis_title_colour = acdc_gold, legend_title_colour = acdc_gold, legend_text_colour = acdc_gold, grid_col = acdc_gold, grid = TRUE, axis_col = acdc_gold, axis = FALSE, ticks = FALSE ) theme_acdc_dark( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_green, subtitle_family = base_family, subtitle_colour = acdc_black, caption_colour = acdc_black, axis_title_colour = acdc_black, legend_title_colour = acdc_black, legend_text_colour = acdc_black, plot_background_fill = tint_colour(acdc_gold, 0.2), grid_col = acdc_green, grid = TRUE, axis_col = acdc_green, axis = FALSE, ticks = FALSE )
theme_acdc_light( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_green, subtitle_family = base_family, subtitle_colour = acdc_gold, caption_colour = acdc_gold, axis_title_colour = acdc_gold, legend_title_colour = acdc_gold, legend_text_colour = acdc_gold, grid_col = acdc_gold, grid = TRUE, axis_col = acdc_gold, axis = FALSE, ticks = FALSE ) theme_acdc_dark( base_family = set_acdc_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = acdc_green, subtitle_family = base_family, subtitle_colour = acdc_black, caption_colour = acdc_black, axis_title_colour = acdc_black, legend_title_colour = acdc_black, legend_text_colour = acdc_black, plot_background_fill = tint_colour(acdc_gold, 0.2), grid_col = acdc_green, grid = TRUE, axis_col = acdc_green, axis = FALSE, ticks = FALSE )
base_family |
Base font family using Africa CDC fonts. Default is set
by what Africa CDC font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default
is |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is |
caption_colour |
Colour of the caption text. Default is |
axis_title_colour |
Colour of the axis title text. Default is
|
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
plot_background_fill |
Fill colour for the plot background. Default is NULL. |
A ggplot2 theme.
The Africa CDC theme is based on the colours from the acdc_palettes
. The
primary palette consists of three colours: acdc_palettes$acdc_primary
. The
secondary palette consists of five colours: acdc_palettes$acdc_secondary
.
The Africa CDC theme uses one or up to two fonts from the four fonts prescribed by the Africa CDC visual identity guidelines. These fonts (in hierarchical order of preference) are Acumin Pro, Brandon Text, Calibri, and/or Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = acdc_palettes$acdc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_acdc_light() ## End(Not run)
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = acdc_palettes$acdc_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_acdc_light() ## End(Not run)
These are wrappers for theme_paleta()
that use colours and fonts from the
NHS visual identity guidelines.
theme_nhs( base_family = set_nhs_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = nhs_blue, subtitle_family = base_family, subtitle_colour = nhs_dark_grey, caption_colour = nhs_dark_grey, axis_title_colour = nhs_dark_grey, legend_title_colour = nhs_dark_grey, legend_text_colour = nhs_dark_grey, grid_col = nhs_mid_grey, grid = TRUE, axis_col = nhs_mid_grey, axis = FALSE, ticks = FALSE )
theme_nhs( base_family = set_nhs_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = nhs_blue, subtitle_family = base_family, subtitle_colour = nhs_dark_grey, caption_colour = nhs_dark_grey, axis_title_colour = nhs_dark_grey, legend_title_colour = nhs_dark_grey, legend_text_colour = nhs_dark_grey, grid_col = nhs_mid_grey, grid = TRUE, axis_col = nhs_mid_grey, axis = FALSE, ticks = FALSE )
base_family |
Base font family using NHS fonts. Default is set
by what NHS font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default
is |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is |
caption_colour |
Colour of the caption text. Default is |
axis_title_colour |
Colour of the axis title text. Default is
|
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
The NHS theme is based on the colours from the nhs_palettes
. The
primary palette consists of two colours: nhs_palettes$nhs_primary
. The
secondary palette consists of nineteen colours:.
The NHS theme uses two fonts as prescribed by the NHS visual identity guidelines. These fonts (in hierarchical order of preference) are Frutiger and Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = nhs_palettes$nhs_support_greens ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_nhs() ## End(Not run)
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = nhs_palettes$nhs_support_greens ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_nhs() ## End(Not run)
This generic/base ggplot2 theme is the template from which all other themes in the paleta package is built on. This theme is inspired by Bob Rudis' hrbrthemes package drawing heavily on its typography-centric focus.
theme_paleta( base_family = set_paleta_font(), base_size = 11.5, plot_title_family = base_family, plot_title_size = 16, plot_title_face = "bold", plot_title_colour = NULL, plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_colour = NULL, subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_colour = NULL, caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_colour = NULL, axis_title_face = "plain", axis_title_just = "rt", legend_title_family = subtitle_family, legend_title_colour = NULL, legend_text_family = subtitle_family, legend_text_colour = NULL, plot_margin = ggplot2::margin(30, 30, 30, 30), plot_background_fill = NULL, grid_col = NULL, grid = TRUE, axis_col = NULL, axis = FALSE, ticks = FALSE )
theme_paleta( base_family = set_paleta_font(), base_size = 11.5, plot_title_family = base_family, plot_title_size = 16, plot_title_face = "bold", plot_title_colour = NULL, plot_title_margin = 10, subtitle_family = base_family, subtitle_size = 12, subtitle_face = "plain", subtitle_colour = NULL, subtitle_margin = 15, strip_text_family = base_family, strip_text_size = 12, strip_text_face = "plain", caption_family = base_family, caption_size = 9, caption_face = "italic", caption_colour = NULL, caption_margin = 10, axis_text_size = base_size, axis_title_family = subtitle_family, axis_title_size = 9, axis_title_colour = NULL, axis_title_face = "plain", axis_title_just = "rt", legend_title_family = subtitle_family, legend_title_colour = NULL, legend_text_family = subtitle_family, legend_text_colour = NULL, plot_margin = ggplot2::margin(30, 30, 30, 30), plot_background_fill = NULL, grid_col = NULL, grid = TRUE, axis_col = NULL, axis = FALSE, ticks = FALSE )
base_family |
Base font family using Africa CDC fonts. Default is set
by what Africa CDC font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_size |
Plot title text size in pts. Default is 16. |
plot_title_face |
Font face ("plain", "italic", "bold", "bold.italic") for plot title. Default is "bold". |
plot_title_colour |
Colour of the plot title text. Default
is |
plot_title_margin |
Margin at the bottom of the plot title. Default set at 10. |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_size |
Plot subtitle text size in pts. Default is 12. |
subtitle_face |
Font face ("plain", "italic", "bold", "bold.italic") for plot subtitle. Default is "plain". |
subtitle_colour |
Colour of the subtitle text. Default is NULL to use default ggplot2 colour. |
subtitle_margin |
Margin at the bottom of the plot subtitle. Default set at 15. |
strip_text_family |
Font family to use for the facet label. Default is
|
strip_text_size |
Facet label text size in pts. Default is 12. |
strip_text_face |
Font face ("plain", "italic", "bold", "bold.italic") for facet label. Default is "plain". |
caption_family |
Font family to use for the caption text. Default is
|
caption_size |
Caption text size in pts. Default is 9. |
caption_face |
Font face ("plain", "italic", "bold", "bold.italic") for caption text. Default is "plain". |
caption_colour |
Colour of the caption text. Default is NULL. |
caption_margin |
Margin at the top of the plot caption text. Default is set at 10. |
axis_text_size |
Axis text size in pts. Default is |
axis_title_family |
Font family to use for the axis title. Default is
|
axis_title_size |
Axis title text size in pts. Default is 9. |
axis_title_colour |
Colour of the axis title text. Default is NULL to use default ggplot2 colour. |
axis_title_face |
Font face ("plain", "italic", "bold", "bold.italic") for axis title. Default is "plain". |
axis_title_just |
Axis title font justification, one of "bl" (bottom-left), "m" (middle), "rt" (right-top). Default is "rt". |
legend_title_family |
Font family to use for the legend title. Default
is |
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_family |
Font family to use for the legend text. Default
is |
legend_text_colour |
Colour of the legend text. Default is NULL. |
plot_margin |
Plot margins (specify with |
plot_background_fill |
Fill colour for the plot background. Default is NULL. |
grid_col |
Grid colour. Default to NULL. |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to NULL. |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
This function uses either of three fonts - Roboto Condensed, Noto Sans, or Roboto (in this specific order) - depending on what is available in the user's system. Roboto Condensed, Noto Sans, and Roboto - all Google fonts - are freely downloadable and easily installed on any system. If any of these fonts is not available in your system, download and install either/all Roboto Condensed, Noto Sans and/or Roboto from Google Fonts.
A ggplot2 theme.
These are wrappers for theme_paleta()
that use colours and fonts from the
UNICEF visual identity guidelines.
theme_unicef( base_family = set_unicef_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, subtitle_colour = unicef_cool_grey, caption_colour = unicef_cool_grey, axis_title_colour = unicef_cool_grey, legend_title_colour = unicef_cool_grey, legend_text_colour = unicef_cool_grey, grid_col = unicef_warm_grey, grid = TRUE, axis_col = unicef_warm_grey, axis = FALSE, ticks = FALSE )
theme_unicef( base_family = set_unicef_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = unicef_black, subtitle_family = base_family, subtitle_colour = unicef_cool_grey, caption_colour = unicef_cool_grey, axis_title_colour = unicef_cool_grey, legend_title_colour = unicef_cool_grey, legend_text_colour = unicef_cool_grey, grid_col = unicef_warm_grey, grid = TRUE, axis_col = unicef_warm_grey, axis = FALSE, ticks = FALSE )
base_family |
Base font family using UNICEF fonts. Default is set
by what UNICEF font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default
is |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is
|
caption_colour |
Colour of the caption text. Default is
|
axis_title_colour |
Colour of the axis title text. Default is
|
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
The UNICEF theme is based on the colours from the unicef_palettes
. The
primary palette consists of one colour: unicef_palettes$unicef_primary
.
The secondary palette consists of eleven colours:
unicef_palettes$unicef_secondary
.
The UNICEF theme uses two fonts as prescribed by the UNICEF visual identity guidelines. These fonts (in hierarchical order of preference) are Univers LT Pro, Arial, Roboto, and Aleo. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = unicef_palettes$unicef_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run)
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = unicef_palettes$unicef_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_unicef() ## End(Not run)
These are wrappers for theme_paleta()
that use colours and fonts from the
World Bank visual identity guidelines.
theme_wb( base_family = set_wb_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = wb_blue, subtitle_family = base_family, subtitle_colour = wb_cyan, caption_colour = wb_blue, axis_title_colour = wb_blue, legend_title_colour = wb_blue, legend_text_colour = wb_blue, grid_col = wb_cyan, grid = TRUE, axis_col = wb_cyan, axis = FALSE, ticks = FALSE )
theme_wb( base_family = set_wb_font(), base_size = 11.5, plot_title_family = base_family, plot_title_colour = wb_blue, subtitle_family = base_family, subtitle_colour = wb_cyan, caption_colour = wb_blue, axis_title_colour = wb_blue, legend_title_colour = wb_blue, legend_text_colour = wb_blue, grid_col = wb_cyan, grid = TRUE, axis_col = wb_cyan, axis = FALSE, ticks = FALSE )
base_family |
Base font family using World Bank fonts. Default is set
by what World Bank font is available in the system via |
base_size |
Base font size. Default is 11.5. |
plot_title_family |
Font family to use for the plot title. Default is
|
plot_title_colour |
Colour of the plot title text. Default
is |
subtitle_family |
Font family to use for the plot subtitle. Default is
|
subtitle_colour |
Colour of the subtitle text. Default is |
caption_colour |
Colour of the caption text. Default is |
axis_title_colour |
Colour of the axis title text. Default is
|
legend_title_colour |
Colour of the legend title text. Default is NULL. |
legend_text_colour |
Colour of the legend text. Default is NULL. |
grid_col |
Grid colour. Default to |
grid |
Panel grid. Either |
axis_col |
Axis colours. Default to |
axis |
Add x or y axes? |
ticks |
Logical. Should ticks be added? Default is FALSE. |
A ggplot2 theme.
The World Bank theme is based on the colours from the wb_palettes
. The
primary palette consists of four colours: wb_palettes$wb_primary
. The
secondary palette consists of fourteen colours: wb_palettes$wb_secondary
.
The World Bank theme uses two fonts as prescribed by the World Bank visual identity guidelines. These fonts (in hierarchical order of preference) are Andes and Arial. Any or all of these fonts should be available in the user's system for them to be used in the theme. If none of these fonts are available in the user's system, a freely downloadable alternative called Noto Sans is the default fallback font and can be obtained from Google Fonts.
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = wb_palettes$wb_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_wb() ## End(Not run)
## Not run: ggplot( data = mtcars, mapping = aes( x = factor(vs, levels = c(0, 1), labels = c("v-shaped", "straight")), fill = factor(cyl)) ) + geom_bar() + scale_fill_manual( name = "Cylinders", values = wb_palettes$wb_secondary ) + labs( title = "Engine shape by number of cylinders", subtitle = "An example plot for this package", x = "Engine Shape", y = "Counts" ) + theme_wb() ## End(Not run)
Get tint of colours
tint_colour(hex, p) tint_colours_(hex, p) tint_colours(hex, p, label = FALSE)
tint_colour(hex, p) tint_colours_(hex, p) tint_colours(hex, p, label = FALSE)
hex |
A character value or vector of character of values for hex code of colour/s to tint. |
p |
A numeric value or vector of numeric values for proportion/s (range from 0 to 1) to tint the colour/s with. |
label |
Logical. Should the output/s be labelled? Default is FALSE. |
A character value or vector of character values of hex code/s tinted to the desired proportion.
tint_colour(acdc_green, p = 0.2) tint_colours(acdc_palettes$acdc_secondary, p = 0.4)
tint_colour(acdc_green, p = 0.2) tint_colours(acdc_palettes$acdc_secondary, p = 0.4)
UNICEF colours
unicef_blue unicef_green unicef_lime_green unicef_yellow unicef_orange unicef_bright_red unicef_dark_red unicef_purple unicef_warm_grey unicef_cool_grey unicef_black unicef_dark_blue
unicef_blue unicef_green unicef_lime_green unicef_yellow unicef_orange unicef_bright_red unicef_dark_red unicef_purple unicef_warm_grey unicef_cool_grey unicef_black unicef_dark_blue
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
unicef_blue unicef_green
unicef_blue unicef_green
The function will search the system for availability of any of the UNICEF
fonts in heirarchical order starting with Andes, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt
.
unicef_fonts set_unicef_font(alt = paleta_fonts$paleta_noto)
unicef_fonts set_unicef_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the UNICEF fonts are not available in the system. |
An object of class list
of length 4.
A character value for font family to use as UNICEF font.
unicef_fonts set_unicef_font()
unicef_fonts set_unicef_font()
UNICEF palettes
unicef_palettes
unicef_palettes
An object of class list
of length 4.
unicef_palettes
unicef_palettes
World Bank colours
wb_blue wb_cyan wb_black wb_white wb_bright_orange wb_bright_yellow wb_bright_red wb_light_orange wb_bright_aqua wb_bright_green wb_bright_purple wb_light_aqua wb_dark_red wb_dark_orange wb_brown wb_dark_purple wb_dark_aqua wb_dark_green
wb_blue wb_cyan wb_black wb_white wb_bright_orange wb_bright_yellow wb_bright_red wb_light_orange wb_bright_aqua wb_bright_green wb_bright_purple wb_light_aqua wb_dark_red wb_dark_orange wb_brown wb_dark_purple wb_dark_aqua wb_dark_green
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
An object of class character
of length 1.
wb_blue wb_cyan
wb_blue wb_cyan
The function will search the system for availability of any of the World Bank
fonts in heirarchical order starting with Andes, and then Arial. If
none of these are found in the system, the function will return Noto Sans
by default or the user can set which font to use as alternative by specifying
alt
.
wb_fonts set_wb_font(alt = paleta_fonts$paleta_noto)
wb_fonts set_wb_font(alt = paleta_fonts$paleta_noto)
alt |
A character value for font family to use if all of the World Bank fonts are not available in the system. |
An object of class list
of length 2.
A character value for font family to use as World Bank font.
wb_fonts set_wb_font()
wb_fonts set_wb_font()
World Bank palettes
wb_palettes
wb_palettes
An object of class list
of length 18.
wb_palettes
wb_palettes