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" ) ) ```