From 07783567c509572daba8687a656751334f95d77d Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 16 Aug 2024 13:27:14 +0200 Subject: [PATCH 1/3] Add tate-color palette --- DESCRIPTION | 2 +- NAMESPACE | 11 ++ NEWS.md | 3 + R/scale_color_tate.R | 229 ++++++++++++++++++++++++++++++++++++++++ man/palette_tate.Rd | 25 +++++ man/scale_color_tate.Rd | 120 +++++++++++++++++++++ man/tate_colors.Rd | 23 ++++ 7 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 R/scale_color_tate.R create mode 100644 man/palette_tate.Rd create mode 100644 man/scale_color_tate.Rd create mode 100644 man/tate_colors.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 63fcbc04c..536d26d18 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: see Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2' -Version: 0.8.5.6 +Version: 0.8.5.7 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NAMESPACE b/NAMESPACE index 7f5dce91b..5a42593bb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -110,6 +110,7 @@ export(palette_okabeito) export(palette_pizza) export(palette_see) export(palette_social) +export(palette_tate) export(pizza_colors) export(plots) export(scale_color_bluebrown) @@ -138,6 +139,9 @@ export(scale_color_see_d) export(scale_color_social) export(scale_color_social_c) export(scale_color_social_d) +export(scale_color_tate) +export(scale_color_tate_c) +export(scale_color_tate_d) export(scale_colour_bluebrown) export(scale_colour_bluebrown_c) export(scale_colour_bluebrown_d) @@ -164,6 +168,9 @@ export(scale_colour_see_d) export(scale_colour_social) export(scale_colour_social_c) export(scale_colour_social_d) +export(scale_colour_tate) +export(scale_colour_tate_c) +export(scale_colour_tate_d) export(scale_fill_bluebrown) export(scale_fill_bluebrown_c) export(scale_fill_bluebrown_d) @@ -190,8 +197,12 @@ export(scale_fill_see_d) export(scale_fill_social) export(scale_fill_social_c) export(scale_fill_social_d) +export(scale_fill_tate) +export(scale_fill_tate_c) +export(scale_fill_tate_d) export(see_colors) export(social_colors) +export(tate_colors) export(theme_abyss) export(theme_blackboard) export(theme_lucid) diff --git a/NEWS.md b/NEWS.md index b9abd37bf..1a316074a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ - New `plot()` method for `performance::check_dag()`. +- New color palette `tate`, inspired by the colors of the Tate Modern museum in + London. See `?scale_color_tate`. + # see 0.8.5 ## Major Changes diff --git a/R/scale_color_tate.R b/R/scale_color_tate.R new file mode 100644 index 000000000..c011c93d0 --- /dev/null +++ b/R/scale_color_tate.R @@ -0,0 +1,229 @@ +#' Tate Modern color palette +#' +#' A color palette inspired by paintings in the Tate Modern Art Museum in London. +#' Use `scale_color_tate_d()` for *discrete* categories and +#' `scale_color_tate_c()` for a *continuous* scale. +#' +#' @inheritParams palette_tate +#' @inheritParams scale_color_flat +#' +#' @examples +#' library(ggplot2) +#' library(see) +#' +#' ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + +#' geom_boxplot() + +#' theme_modern() + +#' scale_fill_tate_d() +#' +#' ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) + +#' geom_point() + +#' theme_abyss() + +#' scale_colour_tate(palette = "fontana") +#' @export +scale_color_tate <- function(palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ...) { + pal <- palette_tate(palette = palette, reverse = reverse) + + if (discrete) { + discrete_scale(aesthetics = aesthetics, palette = pal, ...) + } else { + scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...) + } +} + + + +# Aliases ----------------------------------------------------------------- + + +#' @rdname scale_color_tate +#' @export +scale_color_tate_d <- function(palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ...) { + scale_color_tate( + palette = palette, + discrete = discrete, + reverse = reverse, + aesthetics = aesthetics, + ... + ) +} + +#' @rdname scale_color_tate +#' @export +scale_color_tate_c <- function(palette = "history", + discrete = FALSE, + reverse = FALSE, + aesthetics = "color", + ...) { + scale_color_tate( + palette = palette, + discrete = discrete, + reverse = reverse, + aesthetics = aesthetics, + ... + ) +} + +#' @rdname scale_color_tate +#' @export +scale_colour_tate <- scale_color_tate + +#' @rdname scale_color_tate +#' @export +scale_colour_tate_c <- scale_color_tate_c + +#' @rdname scale_color_tate +#' @export +scale_colour_tate_d <- scale_color_tate_d + + + + + +# Fill -------------------------------------------------------------------- + + + +#' @rdname scale_color_tate +#' @export +scale_fill_tate <- function(palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "fill", + ...) { + pal <- palette_tate(palette = palette, reverse = reverse) + + if (discrete) { + discrete_scale(aesthetics = aesthetics, palette = pal, ...) + } else { + scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...) + } +} + + +#' @rdname scale_color_tate +#' @export +scale_fill_tate_d <- function(palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "fill", + ...) { + scale_fill_tate( + palette = palette, + discrete = discrete, + reverse = reverse, + aesthetics = aesthetics, + ... + ) +} + +#' @rdname scale_color_tate +#' @export +scale_fill_tate_c <- function(palette = "history", + discrete = FALSE, + reverse = FALSE, + aesthetics = "fill", + ...) { + scale_fill_tate( + palette = palette, + discrete = discrete, + reverse = reverse, + aesthetics = aesthetics, + ... + ) +} + + + +# Palette -------------------------------------------------------------------- + + +tate_colors_list <- c( + # history palette + `dark green` = "#625F0E", + brown = "#543111", + amber = "#B47C01", + grey = "#595645", + beige = "#9A8351", + # fontana palette + scarlett = "#7D2D36", + red = "#A5102E", + rose = "#C97B6F", + yellow = "#C78F52" +) + + +#' Extract tate colors as hex codes +#' +#' Can be used to get the hex code of specific colors from the tate color +#' palette. Use `tate_colors()` to see all available colors. +#' +#' @inheritParams flat_colors +#' +#' @return A character vector with color-codes. +#' +#' @examples +#' tate_colors() +#' +#' tate_colors("indigo", "lime") +#' @export +tate_colors <- function(...) { + cols <- c(...) + + if (is.null(cols)) { + return(tate_colors_list) + } + + tate_colors_list[cols] +} + + +tate_palettes <- list( + full = tate_colors(), + history = tate_colors("dark green", "brown", "amber", "grey", "beige"), + fontana = tate_colors("scarlett", "red", "rose", "yellow") +) + + +#' Tate Modern color palette +#' +#' @inheritParams palette_flat +#' +#' @details This function is usually not called directly, but from within +#' [`scale_color_tate()`][scale_color_tate]. +#' +#' @export +palette_tate <- function(palette = "history", reverse = FALSE, ...) { + .retrieve_palette(palette, tate_palettes, reverse = reverse, ...) +} + + + + + +# helper ----------------------- + +.retrieve_palette <- function(palette, palette_list, reverse = FALSE, ...) { + if (!palette %in% names(palette_list)) { + msg <- c(paste0( + "Palette name not available. `palette` must be one of ", + datawizard::text_concatenate(names(palette_list), last = " or ", enclose = "`"), + "." + ), "Using default palette now.") + insight::format_warning(msg) + palette <- 1 + } + pal <- palette_list[[palette]] + + if (reverse) pal <- rev(pal) + + grDevices::colorRampPalette(pal, ...) +} diff --git a/man/palette_tate.Rd b/man/palette_tate.Rd new file mode 100644 index 000000000..499873408 --- /dev/null +++ b/man/palette_tate.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scale_color_history.R +\name{palette_tate} +\alias{palette_tate} +\title{Tate Modern color palette} +\usage{ +palette_tate(palette = "history", reverse = FALSE, ...) +} +\arguments{ +\item{palette}{Character name of palette. Depending on the color scale, can +be \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, +\code{"contrast"}, \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, +or \code{black_first_original}.} + +\item{reverse}{Boolean indicating whether the palette should be reversed.} + +\item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} +} +\description{ +Tate Modern color palette +} +\details{ +This function is usually not called directly, but from within +\code{\link[=scale_color_tate]{scale_color_tate()}}. +} diff --git a/man/scale_color_tate.Rd b/man/scale_color_tate.Rd new file mode 100644 index 000000000..3c26aacf8 --- /dev/null +++ b/man/scale_color_tate.Rd @@ -0,0 +1,120 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scale_color_history.R +\name{scale_color_tate} +\alias{scale_color_tate} +\alias{scale_color_tate_d} +\alias{scale_color_tate_c} +\alias{scale_colour_tate} +\alias{scale_colour_tate_c} +\alias{scale_colour_tate_d} +\alias{scale_fill_tate} +\alias{scale_fill_tate_d} +\alias{scale_fill_tate_c} +\title{Tate Modern color palette} +\usage{ +scale_color_tate( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_color_tate_d( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_color_tate_c( + palette = "history", + discrete = FALSE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_colour_tate( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_colour_tate_c( + palette = "history", + discrete = FALSE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_colour_tate_d( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "color", + ... +) + +scale_fill_tate( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "fill", + ... +) + +scale_fill_tate_d( + palette = "history", + discrete = TRUE, + reverse = FALSE, + aesthetics = "fill", + ... +) + +scale_fill_tate_c( + palette = "history", + discrete = FALSE, + reverse = FALSE, + aesthetics = "fill", + ... +) +} +\arguments{ +\item{palette}{Character name of palette. Depending on the color scale, can +be \code{"full"}, \code{"ice"}, \code{"rainbow"}, \code{"complement"}, +\code{"contrast"}, \code{"light"} (for dark themes), \code{"black_first"}, \code{full_original}, +or \code{black_first_original}.} + +\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} + +\item{reverse}{Boolean indicating whether the palette should be reversed.} + +\item{aesthetics}{A vector of names of the aesthetics that this scale +should be applied to (e.g., \code{c('color', 'fill')}).} + +\item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.} +} +\description{ +A color palette inspired by paintings in the Tate Modern Art Museum in London. +Use \code{scale_color_tate_d()} for \emph{discrete} categories and +\code{scale_color_tate_c()} for a \emph{continuous} scale. +} +\examples{ +library(ggplot2) +library(see) + +ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + + geom_boxplot() + + theme_modern() + + scale_fill_tate_d() + +ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) + + geom_point() + + theme_abyss() + + scale_colour_tate(palette = "fontana") +} diff --git a/man/tate_colors.Rd b/man/tate_colors.Rd new file mode 100644 index 000000000..320ce8e65 --- /dev/null +++ b/man/tate_colors.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scale_color_history.R +\name{tate_colors} +\alias{tate_colors} +\title{Extract tate colors as hex codes} +\usage{ +tate_colors(...) +} +\arguments{ +\item{...}{Character names of colors.} +} +\value{ +A character vector with color-codes. +} +\description{ +Can be used to get the hex code of specific colors from the tate color +palette. Use \code{tate_colors()} to see all available colors. +} +\examples{ +tate_colors() + +tate_colors("indigo", "lime") +} From 0c7ef7996f67b2a3772f2504c69e443cdbc5e45e Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 16 Aug 2024 13:29:07 +0200 Subject: [PATCH 2/3] vignette --- vignettes/seecolorscales.Rmd | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/vignettes/seecolorscales.Rmd b/vignettes/seecolorscales.Rmd index 816b713fa..3125eea26 100644 --- a/vignettes/seecolorscales.Rmd +++ b/vignettes/seecolorscales.Rmd @@ -574,9 +574,25 @@ p8 <- ggplot(d, aes(x, fill = x)) + ) +d <- data.frame( + x = names(tate_colors()) +) + +p9 <- ggplot(d, aes(x, fill = x)) + + geom_bar(width = 0.9) + + scale_fill_manual(values = tate_colors()) + + scale_y_continuous(labels = NULL, expand = c(0, 0)) + + guides(fill = "none") + + ylab(NULL) + + xlab(NULL) + + theme( + axis.text.x = element_text(angle = 90), + panel.grid = element_blank() + ) + plots( - p1, p2, p3, p4, p5, p6, p7, p8, + p1, p2, p3, p4, p5, p6, p7, p8, p9, n_columns = 1L, - tags = c("Social", "Flat", "Material", "Metro", "See", "Pizza", "Bluebrown", "Okabe-Ito") + tags = c("Social", "Flat", "Material", "Metro", "See", "Pizza", "Bluebrown", "Okabe-Ito", "Tate") ) ``` From 99526b8022fad5e704dc100e2f6bcd15d0bd2302 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 19 Aug 2024 17:50:00 +0200 Subject: [PATCH 3/3] add some more colors, vignette --- R/scale_color_tate.R | 47 ++++++++++++++++------ man/palette_tate.Rd | 4 +- man/scale_color_tate.Rd | 20 +++++----- man/tate_colors.Rd | 2 +- vignettes/seecolorscales.Rmd | 44 +++++++++++++++++++++ vignettes/seecolorscales_dark.Rmd | 65 ++++++++++++++++++++++++++++++- 6 files changed, 157 insertions(+), 25 deletions(-) diff --git a/R/scale_color_tate.R b/R/scale_color_tate.R index c011c93d0..e2c6708ff 100644 --- a/R/scale_color_tate.R +++ b/R/scale_color_tate.R @@ -19,9 +19,9 @@ #' ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) + #' geom_point() + #' theme_abyss() + -#' scale_colour_tate(palette = "fontana") +#' scale_colour_tate(palette = "light") #' @export -scale_color_tate <- function(palette = "history", +scale_color_tate <- function(palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -42,7 +42,7 @@ scale_color_tate <- function(palette = "history", #' @rdname scale_color_tate #' @export -scale_color_tate_d <- function(palette = "history", +scale_color_tate_d <- function(palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -58,7 +58,7 @@ scale_color_tate_d <- function(palette = "history", #' @rdname scale_color_tate #' @export -scale_color_tate_c <- function(palette = "history", +scale_color_tate_c <- function(palette = "modern", discrete = FALSE, reverse = FALSE, aesthetics = "color", @@ -94,7 +94,7 @@ scale_colour_tate_d <- scale_color_tate_d #' @rdname scale_color_tate #' @export -scale_fill_tate <- function(palette = "history", +scale_fill_tate <- function(palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "fill", @@ -111,7 +111,7 @@ scale_fill_tate <- function(palette = "history", #' @rdname scale_color_tate #' @export -scale_fill_tate_d <- function(palette = "history", +scale_fill_tate_d <- function(palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "fill", @@ -127,7 +127,7 @@ scale_fill_tate_d <- function(palette = "history", #' @rdname scale_color_tate #' @export -scale_fill_tate_c <- function(palette = "history", +scale_fill_tate_c <- function(palette = "modern", discrete = FALSE, reverse = FALSE, aesthetics = "fill", @@ -157,7 +157,23 @@ tate_colors_list <- c( scarlett = "#7D2D36", red = "#A5102E", rose = "#C97B6F", - yellow = "#C78F52" + yellow = "#C78F52", + # light palettes + `light green` = "#92901F", + `light brown` = "#844C22", + `light amber` = "#D49C02", + `light grey`= "#898765", + `light beige` = "#C4A362", + `light scarlett` = "#A73C46", + `light red` = "#C51A38", + `light rose` = "#E49B90", + `light yellow` = "#E7A963", + # other + mint = "#96FFFA", + teal = "#008080", + orange = "#FF7F00", + blue = "#6495ED", + lavender = "#DDA0DD" ) @@ -188,8 +204,17 @@ tate_colors <- function(...) { tate_palettes <- list( full = tate_colors(), - history = tate_colors("dark green", "brown", "amber", "grey", "beige"), - fontana = tate_colors("scarlett", "red", "rose", "yellow") + modern = tate_colors("yellow", "rose", "red", "brown", "grey", "dark green"), + mix = tate_colors ( + "light rose", "light scarlett", "leight beige", "light grey", + "blue", "orange", "teal", "mint" + ), + history = tate_colors("dark green", "grey", "brown", "beige", "amber"), + fontana = tate_colors("scarlett", "red", "rose", "yellow"), + light = tate_colors( + "light yellow", "light rose", "light red", "light brown", + "light grey", "light green" + ) ) @@ -201,7 +226,7 @@ tate_palettes <- list( #' [`scale_color_tate()`][scale_color_tate]. #' #' @export -palette_tate <- function(palette = "history", reverse = FALSE, ...) { +palette_tate <- function(palette = "modern", reverse = FALSE, ...) { .retrieve_palette(palette, tate_palettes, reverse = reverse, ...) } diff --git a/man/palette_tate.Rd b/man/palette_tate.Rd index 499873408..0616476ce 100644 --- a/man/palette_tate.Rd +++ b/man/palette_tate.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scale_color_history.R +% Please edit documentation in R/scale_color_tate.R \name{palette_tate} \alias{palette_tate} \title{Tate Modern color palette} \usage{ -palette_tate(palette = "history", reverse = FALSE, ...) +palette_tate(palette = "modern", reverse = FALSE, ...) } \arguments{ \item{palette}{Character name of palette. Depending on the color scale, can diff --git a/man/scale_color_tate.Rd b/man/scale_color_tate.Rd index 3c26aacf8..3e7ceb41f 100644 --- a/man/scale_color_tate.Rd +++ b/man/scale_color_tate.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scale_color_history.R +% Please edit documentation in R/scale_color_tate.R \name{scale_color_tate} \alias{scale_color_tate} \alias{scale_color_tate_d} @@ -13,7 +13,7 @@ \title{Tate Modern color palette} \usage{ scale_color_tate( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -21,7 +21,7 @@ scale_color_tate( ) scale_color_tate_d( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -29,7 +29,7 @@ scale_color_tate_d( ) scale_color_tate_c( - palette = "history", + palette = "modern", discrete = FALSE, reverse = FALSE, aesthetics = "color", @@ -37,7 +37,7 @@ scale_color_tate_c( ) scale_colour_tate( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -45,7 +45,7 @@ scale_colour_tate( ) scale_colour_tate_c( - palette = "history", + palette = "modern", discrete = FALSE, reverse = FALSE, aesthetics = "color", @@ -53,7 +53,7 @@ scale_colour_tate_c( ) scale_colour_tate_d( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "color", @@ -61,7 +61,7 @@ scale_colour_tate_d( ) scale_fill_tate( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "fill", @@ -69,7 +69,7 @@ scale_fill_tate( ) scale_fill_tate_d( - palette = "history", + palette = "modern", discrete = TRUE, reverse = FALSE, aesthetics = "fill", @@ -77,7 +77,7 @@ scale_fill_tate_d( ) scale_fill_tate_c( - palette = "history", + palette = "modern", discrete = FALSE, reverse = FALSE, aesthetics = "fill", diff --git a/man/tate_colors.Rd b/man/tate_colors.Rd index 320ce8e65..dd24c61fc 100644 --- a/man/tate_colors.Rd +++ b/man/tate_colors.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scale_color_history.R +% Please edit documentation in R/scale_color_tate.R \name{tate_colors} \alias{tate_colors} \title{Extract tate colors as hex codes} diff --git a/vignettes/seecolorscales.Rmd b/vignettes/seecolorscales.Rmd index 3125eea26..e0badec94 100644 --- a/vignettes/seecolorscales.Rmd +++ b/vignettes/seecolorscales.Rmd @@ -436,6 +436,50 @@ p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group5)) + plots(p1, p2, n_rows = 1) ``` +# Tate Colors + +## Tate Colors - Three Groups + +```{r} +p1 <- ggplot(d1, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate() + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + + geom_point2(size = 2.5) + + scale_color_tate() + +plots(p1, p2, n_rows = 1) +``` + +## Tate Colors - Four Groups + +```{r} +p1 <- ggplot(d2, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate() + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group4)) + + geom_point2(size = 2.5) + + scale_color_tate() + +plots(p1, p2, n_rows = 1) +``` + +## Tate Colors - Five Groups + +```{r} +p1 <- ggplot(d3, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate() + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group5)) + + geom_point2(size = 2.5) + + scale_color_tate() + +plots(p1, p2, n_rows = 1) +``` + # Overview of Palette Colors ```{r fig.height=12,echo=FALSE} diff --git a/vignettes/seecolorscales_dark.Rmd b/vignettes/seecolorscales_dark.Rmd index 6f219b799..53ff5dd59 100644 --- a/vignettes/seecolorscales_dark.Rmd +++ b/vignettes/seecolorscales_dark.Rmd @@ -349,6 +349,50 @@ p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group5)) + plots(p1, p2, n_rows = 1) ``` +# Tate Colors + +## Tate Colors - Three Groups + +```{r} +p1 <- ggplot(d1, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate(palette = "light") + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + + geom_point2(size = 2.5) + + scale_color_tate(palette = "light") + +plots(p1, p2, n_rows = 1) +``` + +## Tate Colors - Four Groups + +```{r} +p1 <- ggplot(d2, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate(palette = "light") + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group4)) + + geom_point2(size = 2.5) + + scale_color_tate(palette = "light") + +plots(p1, p2, n_rows = 1) +``` + +## Tate Colors - Five Groups + +```{r} +p1 <- ggplot(d3, aes(x, y, colour = group)) + + geom_line(linewidth = 1) + + scale_color_tate(palette = "light") + +p2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = group5)) + + geom_point2(size = 2.5) + + scale_color_tate(palette = "light") + +plots(p1, p2, n_rows = 1) +``` + # Overview of Palette Colors ```{r fig.height=12,echo=FALSE} @@ -474,6 +518,23 @@ p7 <- ggplot(d, aes(x, fill = x)) + ) +d <- data.frame( + x = names(tate_colors()) +) + +p8 <- ggplot(d, aes(x, fill = x)) + + geom_bar(width = 0.9) + + scale_fill_manual(values = tate_colors()) + + scale_y_continuous(labels = NULL, expand = c(0, 0)) + + guides(fill = "none") + + ylab(NULL) + + xlab(NULL) + + theme( + axis.text.x = element_text(angle = 90), + panel.grid = element_blank() + ) + + plots( p1, p2, @@ -482,6 +543,7 @@ plots( p5, p6, p7, + p8, n_columns = 1, tags = c( "Social", @@ -490,7 +552,8 @@ plots( "Metro", "See", "Pizza", - "Bluebrown" + "Bluebrown", + "Tate" ) ) ```