diff --git a/R/theme_acdc.R b/R/theme_acdc.R index 2cff93a..19dbfe2 100644 --- a/R/theme_acdc.R +++ b/R/theme_acdc.R @@ -251,15 +251,15 @@ set_acdc_font <- function(alt = paleta_fonts$paleta_noto) { #' @param plot_title_family Font family to use for the plot title. Default is #' `base_family`. #' @param plot_title_colour Colour of the plot title text. Default -#' is `acdc_text`. +#' is [acdc_text]. #' @param subtitle_family Font family to use for the plot subtitle. Default is #' `base_family`. #' @param subtitle_colour Colour of the subtitle text. Default is [acdc_text]. #' @param caption_colour Colour of the caption text. Default is [acdc_text]. #' @param axis_title_colour Colour of the axis title text. Default is -#' `acdc_text`. +#' [acdc_text]. #' @param legend_title_colour Colour of the legend title text. Default is -#' `acdc_text`. +#' [acdc_text]. #' @param legend_text_colour Colour of the legend text. Default is [acdc_text]. #' @param plot_background_fill Fill colour for the plot background. Default is #' NULL. diff --git a/R/theme_nhs.R b/R/theme_nhs.R index dc9f1dc..d8e10ff 100644 --- a/R/theme_nhs.R +++ b/R/theme_nhs.R @@ -263,13 +263,13 @@ set_nhs_font <- function(alt = paleta_fonts$paleta_noto) { #' @param plot_title_family Font family to use for the plot title. Default is #' `base_family`. #' @param plot_title_colour Colour of the plot title text. Default -#' is `nhs_blue`. +#' is [nhs_blue]. #' @param subtitle_family Font family to use for the plot subtitle. Default is -#' `base_family`. +#' `base_family``. #' @param subtitle_colour Colour of the subtitle text. Default is [nhs_mid_grey]. #' @param caption_colour Colour of the caption text. Default is [nhs_mid_grey]. #' @param axis_title_colour Colour of the axis title text. Default is -#' `nhs_cyan`. +#' [nhs_mid_grey]. #' @param legend_title_colour Colour of the legend title text. Default is NULL. #' @param legend_text_colour Colour of the legend text. Default is NULL. #' @param grid_col Grid colour. Default to [nhs_pale_grey]. diff --git a/R/theme_wb.R b/R/theme_wb.R index 2b032d0..2a42abe 100644 --- a/R/theme_wb.R +++ b/R/theme_wb.R @@ -201,13 +201,13 @@ set_wb_font <- function(alt = paleta_fonts$paleta_noto) { #' @param plot_title_family Font family to use for the plot title. Default is #' `base_family`. #' @param plot_title_colour Colour of the plot title text. Default -#' is `wb_blue`. +#' is [wb_blue]. #' @param subtitle_family Font family to use for the plot subtitle. Default is #' `base_family`. #' @param subtitle_colour Colour of the subtitle text. Default is [wb_cyan]. #' @param caption_colour Colour of the caption text. Default is [wb_cyan]. #' @param axis_title_colour Colour of the axis title text. Default is -#' `wb_cyan`. +#' [wb_cyan]. #' @param legend_title_colour Colour of the legend title text. Default is NULL. #' @param legend_text_colour Colour of the legend text. Default is NULL. #' @param grid_col Grid colour. Default to [wb_cyan]. diff --git a/R/utils.R b/R/utils.R index c8679e7..8afd307 100644 --- a/R/utils.R +++ b/R/utils.R @@ -16,7 +16,7 @@ print.palette <- function(x, ...) { ylab = "", xaxt = "n", yaxt = "n", bty = "n") rect(0, 0.9, n + 1, 1.1, col = rgb(1, 1, 1, 0.8), border = NA) - text((n + 1) / 2, 1, labels = attr(x, "name"), cex = 1, family = "serif") + text((n + 1) / 2, 1, labels = attr(x, "name"), cex = 1, family = "sans") } ) } diff --git a/man/theme_acdc.Rd b/man/theme_acdc.Rd index 4d3b6b4..34c5e41 100644 --- a/man/theme_acdc.Rd +++ b/man/theme_acdc.Rd @@ -54,7 +54,7 @@ Sans.} \code{base_family}.} \item{plot_title_colour}{Colour of the plot title text. Default -is \code{acdc_text}.} +is \link{acdc_text}.} \item{subtitle_family}{Font family to use for the plot subtitle. Default is \code{base_family}.} @@ -64,10 +64,10 @@ is \code{acdc_text}.} \item{caption_colour}{Colour of the caption text. Default is \link{acdc_text}.} \item{axis_title_colour}{Colour of the axis title text. Default is -\code{acdc_text}.} +\link{acdc_text}.} \item{legend_title_colour}{Colour of the legend title text. Default is -\code{acdc_text}.} +\link{acdc_text}.} \item{legend_text_colour}{Colour of the legend text. Default is \link{acdc_text}.} diff --git a/man/theme_nhs.Rd b/man/theme_nhs.Rd index 636948d..96f1adc 100644 --- a/man/theme_nhs.Rd +++ b/man/theme_nhs.Rd @@ -34,17 +34,17 @@ If none of the NHS fonts are available, the default becomes \code{base_family}.} \item{plot_title_colour}{Colour of the plot title text. Default -is \code{nhs_blue}.} +is \link{nhs_blue}.} \item{subtitle_family}{Font family to use for the plot subtitle. Default is -\code{base_family}.} +`base_family``.} \item{subtitle_colour}{Colour of the subtitle text. Default is \link{nhs_mid_grey}.} \item{caption_colour}{Colour of the caption text. Default is \link{nhs_mid_grey}.} \item{axis_title_colour}{Colour of the axis title text. Default is -\code{nhs_cyan}.} +\link{nhs_mid_grey}.} \item{legend_title_colour}{Colour of the legend title text. Default is NULL.} diff --git a/man/theme_wb.Rd b/man/theme_wb.Rd index 7e38a27..7d3df33 100644 --- a/man/theme_wb.Rd +++ b/man/theme_wb.Rd @@ -34,7 +34,7 @@ If none of the World Bank fonts are available, the default becomes \code{base_family}.} \item{plot_title_colour}{Colour of the plot title text. Default -is \code{wb_blue}.} +is \link{wb_blue}.} \item{subtitle_family}{Font family to use for the plot subtitle. Default is \code{base_family}.} @@ -44,7 +44,7 @@ is \code{wb_blue}.} \item{caption_colour}{Colour of the caption text. Default is \link{wb_cyan}.} \item{axis_title_colour}{Colour of the axis title text. Default is -\code{wb_cyan}.} +\link{wb_cyan}.} \item{legend_title_colour}{Colour of the legend title text. Default is NULL.} diff --git a/vignettes/africa-cdc.Rmd b/vignettes/africa-cdc.Rmd index 003905a..ec82636 100644 --- a/vignettes/africa-cdc.Rmd +++ b/vignettes/africa-cdc.Rmd @@ -327,7 +327,7 @@ structure( ### Africa CDC light theme ```{r mtcars-acdc-light-bar, echo = FALSE, fig.align = "center", fig.alt = "A bar plot showcasing the Africa CDC light theme", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_acdc_light +## bar plot using theme_acdc_light ggplot( data = mtcars, mapping = aes( @@ -363,7 +363,7 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) + ### Africa CDC dark theme ```{r mtcars-acdc-dark-bar, echo = FALSE, fig.align = "center", fig.alt = "A bar plot showcasing the Africa CDC dark theme", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_acdc_dark +## bar plot using theme_acdc_dark ggplot( data = mtcars, mapping = aes( diff --git a/vignettes/gnc.Rmd b/vignettes/gnc.Rmd index b1991ea..66d6fe0 100644 --- a/vignettes/gnc.Rmd +++ b/vignettes/gnc.Rmd @@ -39,12 +39,82 @@ Complementing **GNC Green** is a set of 10 secondary colours. structure(gnc_palettes$gnc_secondary, class = "palette", name = "GNC Secondary") ``` +## GNC palettes + +In addition to the primary and secondary colours, a set of tinted palettes for each of the GNC primary and secondary colours is available. + +### Tinted green palette + +```{r gnc-tinted-green, echo = FALSE, fig.alt = "GNC tinted green palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_greens, class = "palette", name = "GNC tinted green palette") +``` + +### Tinted grey palette + +```{r gnc-tinted-grey, echo = FALSE, fig.alt = "GNC tinted grey palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_greys, class = "palette", name = "GNC tinted grey palette") +``` + +### Tinted sage palette + +```{r gnc-tinted-sage, echo = FALSE, fig.alt = "GNC tinted sage palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_sages, class = "palette", name = "GNC tinted sage palette") +``` + +### Tinted dark green palette + +```{r gnc-tinted-dark-green, echo = FALSE, fig.alt = "GNC tinted dark green palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_dark_greens, class = "palette", name = "GNC tinted dark green palette") +``` + +### Tinted lime palette + +```{r gnc-tinted-lime, echo = FALSE, fig.alt = "GNC tinted lime palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_limes, class = "palette", name = "GNC tinted lime palette") +``` + +### Tinted aqua green palette + +```{r gnc-tinted-aqua-green, echo = FALSE, fig.alt = "GNC tinted aqua green palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_aqua_greens, class = "palette", name = "GNC tinted aqua green palette") +``` + +### Tinted cyan palette + +```{r gnc-tinted-cyan, echo = FALSE, fig.alt = "GNC tinted cyan palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_cyans, class = "palette", name = "GNC tinted cyan palette") +``` + +### Tinted blue palette + +```{r gnc-tinted-blue, echo = FALSE, fig.alt = "GNC tinted blue palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_blues, class = "palette", name = "GNC tinted blue palette") +``` + +### Tinted orange palette + +```{r gnc-tinted-orange, echo = FALSE, fig.alt = "GNC tinted orange palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_oranges, class = "palette", name = "GNC tinted orange palette") +``` + +### Tinted moss green palette + +```{r gnc-tinted-moss-green, echo = FALSE, fig.alt = "GNC tinted moss green palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_moss_greens, class = "palette", name = "GNC tinted moss green palette") +``` + +### Tinted gold palette + +```{r gnc-tinted-gold, echo = FALSE, fig.alt = "GNC tinted gold palette", fig.align = "center", fig.height = 1} +structure(gnc_palettes$gnc_golds, class = "palette", name = "GNC tinted gold palette") +``` + ## GNC `ggplot2` theme A GNC `ggplot2` theme function called `theme_gnc()` is included in the `paleta` package. Following are examples of how it can be used. ```{r gnc-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the GNC ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_gnc() +## bar plot using theme_gnc() ggplot( data = mtcars, mapping = aes( @@ -76,7 +146,7 @@ ggplot(data = mtcars, mapping = aes(x = mpg, y = disp, colour = factor(cyl))) + title = "GNC Theme", subtitle = "GNC secondary palette", ) + - theme_gnc(grid = "Y") + theme_gnc(grid = "XY") ``` diff --git a/vignettes/nhs.Rmd b/vignettes/nhs.Rmd index 0cd434c..89b1095 100644 --- a/vignettes/nhs.Rmd +++ b/vignettes/nhs.Rmd @@ -330,7 +330,7 @@ structure( An NHS `ggplot2` theme function called `theme_nhs()` is included in the `paleta` package. Following are examples of how it can be used. ```{r nhs-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the NHS ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_nhs() +## bar plot using theme_nhs() ggplot( data = mtcars, mapping = aes( diff --git a/vignettes/unicef.Rmd b/vignettes/unicef.Rmd index 6d29525..b314c62 100644 --- a/vignettes/unicef.Rmd +++ b/vignettes/unicef.Rmd @@ -54,7 +54,7 @@ structure(unicef_palettes$unicef_neutrals, class = "palette", name = "UNICEF Neu A UNICEF `ggplot2` theme function called `theme_unicef()` is included in the `paleta` package. Following are examples of how it can be used. ```{r unicef-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the UNICEF ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_unicef() +## bar plot using theme_unicef() ggplot( data = mtcars, mapping = aes( diff --git a/vignettes/world-bank.Rmd b/vignettes/world-bank.Rmd index def3005..206968e 100644 --- a/vignettes/world-bank.Rmd +++ b/vignettes/world-bank.Rmd @@ -154,7 +154,7 @@ structure(wb_palettes$wb_dark_greens, class = "palette", name = "World Bank Dark A World Bank `ggplot2` theme function called `theme_wb()` is included in the `paleta` package. Following are examples of how it can be used. ```{r wb-theme-bar, echo = FALSE, fig.alt = "A bar plot showcasing the World Bank ggplot2 theme", fig.align = "center", fig.showtext = TRUE, fig.height = 6, fig.width = 5, fig.retina = 1} -## barplot using theme_wb() +## bar plot using theme_wb() ggplot( data = mtcars, mapping = aes(