Type: Package
Title: Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2'
Version: 4.0.0
Maintainer: Nan Xiao <me@nanx.me>
Description: A collection of 'ggplot2' color palettes inspired by plots in scientific journals, data visualization libraries, science fiction movies, and TV shows.
License: GPL (≥ 3)
URL: https://nanx.me/ggsci/, https://github.com/nanxstats/ggsci
BugReports: https://github.com/nanxstats/ggsci/issues
Depends: R (≥ 3.5.0)
Imports: ggplot2 (≥ 2.0.0), grDevices, rlang, scales
Suggests: gridExtra, knitr, ragg, rmarkdown
VignetteBuilder: knitr
Encoding: UTF-8
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2025-09-23 02:57:15 UTC; nanx
Author: Nan Xiao ORCID iD [aut, cre, cph], Joshua Cook [ctb], Clara Jégousse [ctb], Hui Chen [ctb], Miaozhu Li [ctb], iTerm2-Color-Schemes contributors [ctb, cph] (iTerm2-Color-Schemes project), Winston Chang [ctb, cph] (staticimports.R)
Repository: CRAN
Date/Publication: 2025-09-23 05:10:08 UTC

ggsci: Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2'

Description

logo

A collection of 'ggplot2' color palettes inspired by plots in scientific journals, data visualization libraries, science fiction movies, and TV shows.

Author(s)

Maintainer: Nan Xiao me@nanx.me (ORCID) [copyright holder]

Other contributors:

See Also

Useful links:


Example plots for discrete color palettes

Description

Utility functions that return simple ggplot2 examples to demonstrate discrete color/fill scales.

Usage

example_scatterplot()

example_barplot()

Details

Value

A ggplot object.

Examples

example_scatterplot()
example_barplot()

iTerm color palette names

Description

iTerm color palette names

Usage

iterm_palettes()

Value

Character vector of palette names.

Examples

iterm_palettes()

AAAS journal color palettes

Description

Color palettes inspired by plots in journals published by American Association for the Advancement of Science (AAAS), such as Science and Science Translational Medicine.

Usage

pal_aaas(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette inspired by Science).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_aaas("default")(10))
show_col(pal_aaas("default", alpha = 0.6)(10))

Atlassian Design System palette

Description

The Atlassian Design System categorical data visualization palette.

Usage

pal_atlassian(palette = c("categorical8"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "categorical8" (8-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

Atlassian (2025). "Atlassian Design System categorical chart colors." https://atlassian.design/foundations/color-new/data-visualization-color

Examples

library("scales")
show_col(pal_atlassian("categorical8")(8))
show_col(pal_atlassian("categorical8", alpha = 0.6)(8))

BMJ color palettes

Description

Color palette from the BMJ living style guide.

Usage

pal_bmj(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (9-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Hui Chen | huichen@zju.edu.cn

References

https://technology.bmj.com/living-style-guide/colour.html

Examples

library("scales")
show_col(pal_bmj("default")(9))
show_col(pal_bmj("default", alpha = 0.6)(9))

Bootstrap 5 color palettes

Description

Bootstrap 5 color palettes.

Usage

pal_bs5(
  palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green",
    "teal", "cyan", "gray"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 11 available options:

  • "blue"

  • "indigo"

  • "purple"

  • "pink"

  • "red"

  • "orange"

  • "yellow"

  • "green"

  • "teal"

  • "cyan"

  • "gray"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_bs5("indigo")(10))
show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))

COSMIC color palettes

Description

Color palettes inspired by the colors used in projects from the Catalogue Of Somatic Mutations in Cancers (COSMIC).

Usage

pal_cosmic(
  palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"),
  alpha = 1
)

Arguments

palette

Palette type. Currently there are three available options:

  • "signature_substitutions" (6-color palette).

  • "hallmarks_light" (10-color palette).

  • "hallmarks_dark" (10-color palette).

The "hallmarks_light" option is from Hanahan and Weinberg (2011).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Joshua H. Cook | joshuacook0023@gmail.com | @jhrcook

Examples

library("scales")
show_col(pal_cosmic("hallmarks_light")(10))
show_col(pal_cosmic("hallmarks_light", alpha = 0.6)(10))
show_col(pal_cosmic("hallmarks_dark")(10))
show_col(pal_cosmic("hallmarks_dark", alpha = 0.6)(10))
show_col(pal_cosmic("signature_substitutions")(6))
show_col(pal_cosmic("signature_substitutions", alpha = 0.6)(6))

D3.js color palettes

Description

Color palettes based on the colors used by D3.js.

Usage

pal_d3(
  palette = c("category10", "category20", "category20b", "category20c"),
  alpha = 1
)

Arguments

palette

Palette type. There are four available options:

  • "category10" (10-color palette).

  • "category20" (20-color palette).

  • "category20b" (20-color palette).

  • "category20c" (20-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md

Examples

library("scales")
show_col(pal_d3("category10")(10))
show_col(pal_d3("category20")(20))
show_col(pal_d3("category20b")(20))
show_col(pal_d3("category20c")(20))

Flat UI color palettes

Description

Color palettes inspired by the Flat UI colors.

Usage

pal_flatui(palette = c("default", "flattastic", "aussie"), alpha = 1)

Arguments

palette

Palette type. Currently there are three available options:

  • "default" (10-color palette).

  • "flattastic" (12-color palette).

  • "aussie" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Clara Jégousse | cat3@hi.is

Examples

library("scales")
show_col(pal_flatui("default")(10))
show_col(pal_flatui("flattastic")(12))
show_col(pal_flatui("aussie")(10))
show_col(pal_flatui("aussie", alpha = 0.6)(10))

Frontiers journal color palettes

Description

Color palettes inspired by the colors used in Frontiers journals.

Usage

pal_frontiers(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Clara Jégousse | cat3@hi.is

Examples

library("scales")
show_col(pal_frontiers("default")(7))
show_col(pal_frontiers("default", alpha = 0.6)(7))

Futurama color palettes

Description

Color palettes inspired by the colors used in Futurama.

Usage

pal_futurama(palette = c("planetexpress"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "planetexpress" (12-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_futurama("planetexpress")(12))
show_col(pal_futurama("planetexpress", alpha = 0.6)(12))

The GSEA GenePattern color palettes

Description

Color palette inspired by the colors used in the heatmaps plotted by GSEA GenePattern.

Usage

pal_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)

Arguments

palette

Palette type. Currently there is one available option: "default" (continuous palette with 12 base colors).

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_gsea("default")(12))
show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))

Integrative Genomics Viewer (IGV) color palettes

Description

Color palettes based on the colors used by Integrative Genomics Viewer (IGV).

Usage

pal_igv(palette = c("default", "alternating"), alpha = 1)

Arguments

palette

Palette type. There are two available options:

  • "default" (51-color palette).

  • "alternating" (2-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

James T. Robinson, Helga Thorvaldsdóttir, Wendy Winckler, Mitchell Guttman, Eric S. Lander, Gad Getz, Jill P. Mesirov. Integrative Genomics Viewer. Nature Biotechnology 29, 24–26 (2011).

Examples

library("scales")
show_col(pal_igv("default")(51))
show_col(pal_igv("alternating")(2))

iTerm color palettes

Description

ANSI terminal color palettes sourced from the iterm2-color-schemes project. Each theme provides normal and bright variants.

Usage

pal_iterm(
  palette = iterm_palettes(),
  variant = c("normal", "bright"),
  alpha = 1
)

Arguments

palette

Palette name. See iterm_palettes() for available options.

variant

Variant of the palette. One of "normal", "bright".

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

References

https://github.com/mbadolato/iTerm2-Color-Schemes

Examples

library("scales")
show_col(pal_iterm("Rose Pine")(6))
show_col(pal_iterm("Rose Pine", variant = "bright", alpha = 0.7)(6))

Journal of the American Medical Association color palettes

Description

Color palette inspired by plots in The Journal of the American Medical Association.

Usage

pal_jama(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_jama("default")(7))
show_col(pal_jama("default", alpha = 0.6)(7))

Journal of Clinical Oncology color palettes

Description

Color palette inspired by plots in Journal of Clinical Oncology.

Usage

pal_jco(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_jco("default")(10))
show_col(pal_jco("default", alpha = 0.6)(10))

Lancet journal color palettes

Description

Color palettes inspired by plots in Lancet journals, such as Lancet Oncology.

Usage

pal_lancet(palette = c("lanonc"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "lanonc" (9-color palette inspired by Lancet Oncology).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_lancet("lanonc")(9))
show_col(pal_lancet("lanonc", alpha = 0.6)(9))

LocusZoom color palette

Description

Color palettes based on the colors used by LocusZoom.

Usage

pal_locuszoom(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

Pruim, Randall J., et al. (2010). LocusZoom: regional visualization of genome-wide association scan results. Bioinformatics, 26(18), 2336–2337.

Examples

library("scales")
show_col(pal_locuszoom("default")(7))
show_col(pal_locuszoom("default", alpha = 0.6)(7))

Material Design color palettes

Description

Material Design 2 color palettes.

Usage

pal_material(
  palette = c("red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue",
    "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange",
    "deep-orange", "brown", "grey", "blue-grey"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 19 available options:

  • "red"

  • "pink"

  • "purple"

  • "deep-purple"

  • "indigo"

  • "blue"

  • "light-blue"

  • "cyan"

  • "teal"

  • "green"

  • "light-green"

  • "lime"

  • "yellow"

  • "amber"

  • "orange"

  • "deep-orange"

  • "brown"

  • "grey"

  • "blue-grey"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_material("indigo")(10))
show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))

NEJM color palettes

Description

Color palette inspired by plots in The New England Journal of Medicine.

Usage

pal_nejm(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (8-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_nejm("default")(8))
show_col(pal_nejm("default", alpha = 0.6)(8))

NPG journal color palettes

Description

Color palettes inspired by plots in journals published by Nature Publishing Group, such as Nature Reviews Cancer.

Usage

pal_npg(palette = c("nrc"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "nrc" (10-color palette inspired by Nature Reviews Cancer).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_npg("nrc")(10))
show_col(pal_npg("nrc", alpha = 0.6)(10))

Observable 10 color palette

Description

The Observable 10 palette.

Usage

pal_observable(palette = c("observable10"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "observable10" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

Pettiross J (2023). "Crafting data colors and staying on brand." Observable blog. https://observablehq.com/blog/crafting-data-colors

Examples

library("scales")
show_col(pal_observable("observable10")(10))
show_col(pal_observable("observable10", alpha = 0.6)(10))

Primer design system palette

Description

The Primer design system data visualization palette.

Usage

pal_primer(palette = c("mark17"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "mark17" (17-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

GitHub (2025). "Primer data visualization colors." https://primer.style/product/ui-patterns/data-visualization/

Examples

library("scales")
show_col(pal_primer("mark17")(17))
show_col(pal_primer("mark17", alpha = 0.6)(17))

Rick and Morty color palettes

Description

Color palettes inspired by the colors used in Rick and Morty.

Usage

pal_rickandmorty(palette = c("schwifty"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "schwifty" (12-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_rickandmorty("schwifty")(12))
show_col(pal_rickandmorty("schwifty", alpha = 0.6)(12))

The Simpsons color palettes

Description

Color palettes inspired by the colors used in The Simpsons.

Usage

pal_simpsons(palette = c("springfield"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "springfield" (16-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_simpsons("springfield")(16))
show_col(pal_simpsons("springfield", alpha = 0.6)(16))

Star Trek color palettes

Description

Color palettes inspired by the colors used in Star Trek.

Usage

pal_startrek(palette = c("uniform"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "uniform" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_startrek("uniform")(7))
show_col(pal_startrek("uniform", alpha = 0.6)(7))

Tron Legacy color palettes

Description

Color palettes inspired by the colors used in Tron Legacy.

Usage

pal_tron(palette = c("legacy"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "legacy" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_tron("legacy")(7))
show_col(pal_tron("legacy", alpha = 0.6)(7))

Tailwind CSS color palettes

Description

Tailwind CSS color palettes.

Usage

pal_tw3(
  palette = c("slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber",
    "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo",
    "violet", "purple", "fuchsia", "pink", "rose"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 22 available options:

  • "slate"

  • "gray"

  • "zinc"

  • "neutral"

  • "stone"

  • "red"

  • "orange"

  • "amber"

  • "yellow"

  • "lime"

  • "green"

  • "emerald"

  • "teal"

  • "cyan"

  • "sky"

  • "blue"

  • "indigo"

  • "violet"

  • "purple"

  • "fuchsia"

  • "pink"

  • "rose"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_tw3("rose")(10))
show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))

The University of Chicago color palettes

Description

Color palettes based on the colors used by the University of Chicago.

Usage

pal_uchicago(palette = c("default", "light", "dark"), alpha = 1)

Arguments

palette

Palette type. There are three available options:

  • "default" (9-color palette);

  • "light" (9-color light palette);

  • "dark" (9-color dark palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://news.uchicago.edu/sites/default/files/attachments/_uchicago.identity.guidelines.pdf

Examples

library("scales")
show_col(pal_uchicago("default")(9))
show_col(pal_uchicago("light")(9))
show_col(pal_uchicago("dark")(9))

UCSC Genome Browser color palette

Description

Color palette from UCSC Genome Browser chromosome colors.

Usage

pal_ucscgb(palette = c("default"), alpha = 1)

Arguments

palette

Palette type. Currently there is one available option: "default" (26-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_ucscgb("default")(26))
show_col(pal_ucscgb("default", alpha = 0.6)(26))

Bootstrap 5 color palettes

Description

Bootstrap 5 color palettes.

Usage

rgb_bs5(
  palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green",
    "teal", "cyan", "gray"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 11 available options:

  • "blue"

  • "indigo"

  • "purple"

  • "pink"

  • "red"

  • "orange"

  • "yellow"

  • "green"

  • "teal"

  • "cyan"

  • "gray"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://getbootstrap.com/docs/5.3/customize/color/#all-colors

Examples

library("scales")
show_col(pal_bs5("indigo")(10))
show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))

The GSEA GenePattern color palettes

Description

Color palette inspired by the colors used in the heatmaps plotted by GSEA GenePattern.

Usage

rgb_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)

Arguments

palette

Palette type. Currently there is one available option: "default" (continuous palette with 12 base colors).

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Note

The 12 base colors used in this palette are derived from the HeatMapImage documentation.

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("scales")
show_col(pal_gsea("default")(12))
show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))

Material Design color palettes

Description

Material Design 2 color palettes.

Usage

rgb_material(
  palette = c("red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue",
    "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange",
    "deep-orange", "brown", "grey", "blue-grey"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 19 available options:

  • "red"

  • "pink"

  • "purple"

  • "deep-purple"

  • "indigo"

  • "blue"

  • "light-blue"

  • "cyan"

  • "teal"

  • "green"

  • "light-green"

  • "lime"

  • "yellow"

  • "amber"

  • "orange"

  • "deep-orange"

  • "brown"

  • "grey"

  • "blue-grey"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://m2.material.io/design/color/the-color-system.html

Examples

library("scales")
show_col(pal_material("indigo")(10))
show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))

Tailwind CSS color palettes

Description

Tailwind CSS color palettes.

Usage

rgb_tw3(
  palette = c("slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber",
    "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo",
    "violet", "purple", "fuchsia", "pink", "rose"),
  n = 10,
  alpha = 1,
  reverse = FALSE
)

Arguments

palette

Palette type. There are 22 available options:

  • "slate"

  • "gray"

  • "zinc"

  • "neutral"

  • "stone"

  • "red"

  • "orange"

  • "amber"

  • "yellow"

  • "lime"

  • "green"

  • "emerald"

  • "teal"

  • "cyan"

  • "sky"

  • "blue"

  • "indigo"

  • "violet"

  • "purple"

  • "fuchsia"

  • "pink"

  • "rose"

n

Number of individual colors to be generated.

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://tailwindcss.com/docs/customizing-colors

Examples

library("scales")
show_col(pal_tw3("rose")(10))
show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))

AAAS journal color scales

Description

See pal_aaas() for details.

Usage

scale_color_aaas(palette = c("default"), alpha = 1, ...)

scale_colour_aaas(palette = c("default"), alpha = 1, ...)

scale_fill_aaas(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette inspired by Science).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_aaas()
example_barplot() + scale_fill_aaas()

Atlassian Design System color scales

Description

See pal_atlassian() for details.

Usage

scale_color_atlassian(palette = c("categorical8"), alpha = 1, ...)

scale_colour_atlassian(palette = c("categorical8"), alpha = 1, ...)

scale_fill_atlassian(palette = c("categorical8"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "categorical8" (8-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

Atlassian (2025). "Atlassian Design System categorical chart colors." https://atlassian.design/foundations/color-new/data-visualization-color

Examples

example_scatterplot() + scale_color_atlassian()
example_barplot() + scale_fill_atlassian()

BMJ color scales

Description

See pal_bmj() for details.

Usage

scale_color_bmj(palette = c("default"), alpha = 1, ...)

scale_colour_bmj(palette = c("default"), alpha = 1, ...)

scale_fill_bmj(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (9-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Hui Chen | huichen@zju.edu.cn

References

https://technology.bmj.com/living-style-guide/colour.html

Examples

example_scatterplot() + scale_color_bmj()
example_barplot() + scale_fill_bmj()

Bootstrap 5 color scales

Description

See pal_bs5() for details.

Usage

scale_color_bs5(
  palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green",
    "teal", "cyan", "gray"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_colour_bs5(
  palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green",
    "teal", "cyan", "gray"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_fill_bs5(
  palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green",
    "teal", "cyan", "gray"),
  alpha = 1,
  reverse = FALSE,
  ...
)

Arguments

palette

Palette type. There are 11 available options:

  • "blue"

  • "indigo"

  • "purple"

  • "pink"

  • "red"

  • "orange"

  • "yellow"

  • "green"

  • "teal"

  • "cyan"

  • "gray"

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("ggplot2")

data("mtcars")
cor <- abs(cor(mtcars))
cor_melt <- data.frame(
  Var1 = rep(seq_len(nrow(cor)), times = ncol(cor)),
  Var2 = rep(seq_len(ncol(cor)), each = nrow(cor)),
  value = as.vector(cor)
)

ggplot(
  cor_melt,
  aes(x = Var1, y = Var2, fill = value)
) +
  geom_tile(colour = "black", size = 0.3) +
  theme_bw() +
  scale_fill_bs5("teal")

COSMIC color scales

Description

See pal_cosmic() for details.

Usage

scale_color_cosmic(
  palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"),
  alpha = 1,
  ...
)

scale_colour_cosmic(
  palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"),
  alpha = 1,
  ...
)

scale_fill_cosmic(
  palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"),
  alpha = 1,
  ...
)

Arguments

palette

Palette type. Currently there are three available options:

  • "signature_substitutions" (6-color palette).

  • "hallmarks_light" (10-color palette).

  • "hallmarks_dark" (10-color palette).

The "hallmarks_light" option is from Hanahan and Weinberg (2011).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Joshua H. Cook | joshuacook0023@gmail.com | @jhrcook

Examples

example_scatterplot() + scale_color_cosmic()
example_barplot() + scale_fill_cosmic()

D3.js color scales

Description

See pal_d3() for details.

Usage

scale_color_d3(
  palette = c("category10", "category20", "category20b", "category20c"),
  alpha = 1,
  ...
)

scale_colour_d3(
  palette = c("category10", "category20", "category20b", "category20c"),
  alpha = 1,
  ...
)

scale_fill_d3(
  palette = c("category10", "category20", "category20b", "category20c"),
  alpha = 1,
  ...
)

Arguments

palette

Palette type. There are four available options:

  • "category10" (10-color palette).

  • "category20" (20-color palette).

  • "category20b" (20-color palette).

  • "category20c" (20-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md

Examples

p1 <- example_scatterplot()
p2 <- example_barplot()

p1 + scale_color_d3()
p2 + scale_fill_d3()

p1 + scale_color_d3(palette = "category20")
p2 + scale_fill_d3(palette = "category20")

p1 + scale_color_d3(palette = "category20b")
p2 + scale_fill_d3(palette = "category20b")

p1 + scale_color_d3(palette = "category20c")
p2 + scale_fill_d3(palette = "category20c")

Flat UI color scales

Description

See pal_flatui() for details.

Usage

scale_color_flatui(
  palette = c("default", "flattastic", "aussie"),
  alpha = 1,
  ...
)

scale_colour_flatui(
  palette = c("default", "flattastic", "aussie"),
  alpha = 1,
  ...
)

scale_fill_flatui(
  palette = c("default", "flattastic", "aussie"),
  alpha = 1,
  ...
)

Arguments

palette

Palette type. Currently there are three available options:

  • "default" (10-color palette).

  • "flattastic" (12-color palette).

  • "aussie" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Clara Jégousse | cat3@hi.is

Examples

p1 <- example_scatterplot()
p2 <- example_barplot()

p1 + scale_color_flatui()
p2 + scale_fill_flatui()

p1 + scale_color_flatui(palette = "default")
p2 + scale_fill_flatui(palette = "default")

p1 + scale_color_flatui(palette = "flattastic")
p2 + scale_fill_flatui(palette = "flattastic")

p1 + scale_color_flatui(palette = "aussie")
p2 + scale_fill_flatui(palette = "aussie")

Frontiers journal color scales

Description

See pal_frontiers() for details.

Usage

scale_color_frontiers(palette = c("default"), alpha = 1, ...)

scale_colour_frontiers(palette = c("default"), alpha = 1, ...)

scale_fill_frontiers(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Clara Jégousse | cat3@hi.is

Examples

example_scatterplot() +
  ggplot2::theme_dark() +
  ggplot2::theme(
    panel.background = ggplot2::element_rect(fill = "#2D2D2D"),
    legend.key = ggplot2::element_rect(fill = "#2D2D2D")
  ) +
  scale_color_frontiers()

example_barplot() +
  ggplot2::theme_dark() +
  ggplot2::theme(
    panel.background = ggplot2::element_rect(fill = "#2D2D2D")
  ) +
  scale_fill_frontiers()

Futurama color scales

Description

See pal_futurama() for details.

Usage

scale_color_futurama(palette = c("planetexpress"), alpha = 1, ...)

scale_colour_futurama(palette = c("planetexpress"), alpha = 1, ...)

scale_fill_futurama(palette = c("planetexpress"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "planetexpress" (12-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_futurama()
example_barplot() + scale_fill_futurama()

The GSEA GenePattern color scales

Description

See pal_gsea() for details.

Usage

scale_color_gsea(palette = c("default"), alpha = 1, reverse = FALSE, ...)

scale_colour_gsea(palette = c("default"), alpha = 1, reverse = FALSE, ...)

scale_fill_gsea(palette = c("default"), alpha = 1, reverse = FALSE, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (continuous palette with 12 base colors).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("ggplot2")

data("mtcars")
cor <- cor(mtcars)
cor_melt <- data.frame(
  Var1 = rep(seq_len(nrow(cor)), times = ncol(cor)),
  Var2 = rep(seq_len(ncol(cor)), each = nrow(cor)),
  value = as.vector(cor)
)

ggplot(
  cor_melt,
  aes(x = Var1, y = Var2, fill = value)
) +
  geom_tile(colour = "black", size = 0.3) +
  theme_bw() +
  scale_fill_gsea()

Integrative Genomics Viewer (IGV) color scales

Description

See pal_igv() for details.

Usage

scale_color_igv(palette = c("default", "alternating"), alpha = 1, ...)

scale_colour_igv(palette = c("default", "alternating"), alpha = 1, ...)

scale_fill_igv(palette = c("default", "alternating"), alpha = 1, ...)

Arguments

palette

Palette type. There are two available options:

  • "default" (51-color palette).

  • "alternating" (2-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

p1 <- example_scatterplot()
p2 <- example_barplot()

p1 + scale_color_igv()
p2 + scale_fill_igv()

p1 + ggplot2::scale_colour_manual(
  values = rep(pal_igv("alternating")(2), times = 3)
)
p2 + ggplot2::scale_fill_manual(
  values = rep(pal_igv("alternating")(2), times = 3)
)

iTerm color scales

Description

See pal_iterm() for details.

Usage

scale_color_iterm(
  palette = iterm_palettes(),
  variant = c("normal", "bright"),
  alpha = 1,
  ...
)

scale_colour_iterm(
  palette = iterm_palettes(),
  variant = c("normal", "bright"),
  alpha = 1,
  ...
)

scale_fill_iterm(
  palette = iterm_palettes(),
  variant = c("normal", "bright"),
  alpha = 1,
  ...
)

Arguments

palette

Palette name. See iterm_palettes() for available options.

variant

Variant of the palette. One of "normal", "bright".

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Examples

example_scatterplot() + scale_color_iterm("Rose Pine")
example_barplot() + scale_fill_iterm("Rose Pine")

Journal of the American Medical Association color scales

Description

See pal_jama() for details.

Usage

scale_color_jama(palette = c("default"), alpha = 1, ...)

scale_colour_jama(palette = c("default"), alpha = 1, ...)

scale_fill_jama(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_jama()
example_barplot() + scale_fill_jama()

Journal of Clinical Oncology color scales

Description

See pal_jco() for details.

Usage

scale_color_jco(palette = c("default"), alpha = 1, ...)

scale_colour_jco(palette = c("default"), alpha = 1, ...)

scale_fill_jco(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_jco()
example_barplot() + scale_fill_jco()

Lancet journal color scales

Description

See pal_lancet() for details.

Usage

scale_color_lancet(palette = c("lanonc"), alpha = 1, ...)

scale_colour_lancet(palette = c("lanonc"), alpha = 1, ...)

scale_fill_lancet(palette = c("lanonc"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "lanonc" (9-color palette inspired by Lancet Oncology).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_lancet()
example_barplot() + scale_fill_lancet()

LocusZoom color scales

Description

See pal_locuszoom() for details.

Usage

scale_color_locuszoom(palette = c("default"), alpha = 1, ...)

scale_colour_locuszoom(palette = c("default"), alpha = 1, ...)

scale_fill_locuszoom(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_locuszoom()
example_barplot() + scale_fill_locuszoom()

Material Design color scales

Description

See pal_material() for details.

Usage

scale_color_material(
  palette = c("red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue",
    "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange",
    "deep-orange", "brown", "grey", "blue-grey"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_colour_material(
  palette = c("red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue",
    "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange",
    "deep-orange", "brown", "grey", "blue-grey"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_fill_material(
  palette = c("red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue",
    "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange",
    "deep-orange", "brown", "grey", "blue-grey"),
  alpha = 1,
  reverse = FALSE,
  ...
)

Arguments

palette

Palette type. There are 19 available options:

  • "red"

  • "pink"

  • "purple"

  • "deep-purple"

  • "indigo"

  • "blue"

  • "light-blue"

  • "cyan"

  • "teal"

  • "green"

  • "light-green"

  • "lime"

  • "yellow"

  • "amber"

  • "orange"

  • "deep-orange"

  • "brown"

  • "grey"

  • "blue-grey"

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("ggplot2")

data("mtcars")
cor <- abs(cor(mtcars))
cor_melt <- data.frame(
  Var1 = rep(seq_len(nrow(cor)), times = ncol(cor)),
  Var2 = rep(seq_len(ncol(cor)), each = nrow(cor)),
  value = as.vector(cor)
)

ggplot(
  cor_melt,
  aes(x = Var1, y = Var2, fill = value)
) +
  geom_tile(colour = "black", size = 0.3) +
  theme_bw() +
  scale_fill_material("blue-grey")

NEJM color scales

Description

See pal_nejm() for details.

Usage

scale_color_nejm(palette = c("default"), alpha = 1, ...)

scale_colour_nejm(palette = c("default"), alpha = 1, ...)

scale_fill_nejm(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (8-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_nejm()
example_barplot() + scale_fill_nejm()

NPG journal color scales

Description

See pal_npg() for details.

Usage

scale_color_npg(palette = c("nrc"), alpha = 1, ...)

scale_colour_npg(palette = c("nrc"), alpha = 1, ...)

scale_fill_npg(palette = c("nrc"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "nrc" (10-color palette inspired by Nature Reviews Cancer).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_npg()
example_barplot() + scale_fill_npg()

Observable 10 color scales

Description

See pal_observable() for details.

Usage

scale_color_observable(palette = c("observable10"), alpha = 1, ...)

scale_colour_observable(palette = c("observable10"), alpha = 1, ...)

scale_fill_observable(palette = c("observable10"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "observable10" (10-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

Pettiross J (2023). "Crafting data colors and staying on brand." Observable blog. https://observablehq.com/blog/crafting-data-colors

Examples

example_scatterplot() + scale_color_observable()
example_barplot() + scale_fill_observable()

Primer color scales

Description

See pal_primer() for details.

Usage

scale_color_primer(palette = c("mark17"), alpha = 1, ...)

scale_colour_primer(palette = c("mark17"), alpha = 1, ...)

scale_fill_primer(palette = c("mark17"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "mark17" (17-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

GitHub (2025). "Primer data visualization colors." https://primer.style/product/ui-patterns/data-visualization/

Examples

example_scatterplot() + scale_color_primer()
example_barplot() + scale_fill_primer()

Rick and Morty color scales

Description

See pal_rickandmorty() for details.

Usage

scale_color_rickandmorty(palette = c("schwifty"), alpha = 1, ...)

scale_colour_rickandmorty(palette = c("schwifty"), alpha = 1, ...)

scale_fill_rickandmorty(palette = c("schwifty"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "schwifty" (12-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_rickandmorty()
example_barplot() + scale_fill_rickandmorty()

The Simpsons color scales

Description

See pal_simpsons() for details.

Usage

scale_color_simpsons(palette = c("springfield"), alpha = 1, ...)

scale_colour_simpsons(palette = c("springfield"), alpha = 1, ...)

scale_fill_simpsons(palette = c("springfield"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "springfield" (16-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_simpsons()
example_barplot() + scale_fill_simpsons()

Star Trek color scales

Description

See pal_startrek() for details.

Usage

scale_color_startrek(palette = c("uniform"), alpha = 1, ...)

scale_colour_startrek(palette = c("uniform"), alpha = 1, ...)

scale_fill_startrek(palette = c("uniform"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "uniform" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_startrek()
example_barplot() + scale_fill_startrek()

Tron Legacy color scales

Description

See pal_tron() for details.

Usage

scale_color_tron(palette = c("legacy"), alpha = 1, ...)

scale_colour_tron(palette = c("legacy"), alpha = 1, ...)

scale_fill_tron(palette = c("legacy"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "legacy" (7-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() +
  ggplot2::theme_dark() +
  ggplot2::theme(
    panel.background = ggplot2::element_rect(fill = "#2D2D2D"),
    legend.key = ggplot2::element_rect(fill = "#2D2D2D")
  ) +
  scale_color_tron()

example_barplot() +
  ggplot2::theme_dark() +
  ggplot2::theme(
    panel.background = ggplot2::element_rect(fill = "#2D2D2D")
  ) +
  scale_fill_tron()

Tailwind CSS color scales

Description

See pal_tw3() for details.

Usage

scale_color_tw3(
  palette = c("slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber",
    "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo",
    "violet", "purple", "fuchsia", "pink", "rose"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_colour_tw3(
  palette = c("slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber",
    "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo",
    "violet", "purple", "fuchsia", "pink", "rose"),
  alpha = 1,
  reverse = FALSE,
  ...
)

scale_fill_tw3(
  palette = c("slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber",
    "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo",
    "violet", "purple", "fuchsia", "pink", "rose"),
  alpha = 1,
  reverse = FALSE,
  ...
)

Arguments

palette

Palette type. There are 22 available options:

  • "slate"

  • "gray"

  • "zinc"

  • "neutral"

  • "stone"

  • "red"

  • "orange"

  • "amber"

  • "yellow"

  • "lime"

  • "green"

  • "emerald"

  • "teal"

  • "cyan"

  • "sky"

  • "blue"

  • "indigo"

  • "violet"

  • "purple"

  • "fuchsia"

  • "pink"

  • "rose"

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

reverse

Logical. Should the order of the colors be reversed?

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

library("ggplot2")

data("mtcars")
cor <- abs(cor(mtcars))
cor_melt <- data.frame(
  Var1 = rep(seq_len(nrow(cor)), times = ncol(cor)),
  Var2 = rep(seq_len(ncol(cor)), each = nrow(cor)),
  value = as.vector(cor)
)

ggplot(
  cor_melt,
  aes(x = Var1, y = Var2, fill = value)
) +
  geom_tile(colour = "black", size = 0.3) +
  theme_bw() +
  scale_fill_tw3("slate")

The University of Chicago color scales

Description

See pal_uchicago() for details.

Usage

scale_color_uchicago(palette = c("default", "light", "dark"), alpha = 1, ...)

scale_colour_uchicago(palette = c("default", "light", "dark"), alpha = 1, ...)

scale_fill_uchicago(palette = c("default", "light", "dark"), alpha = 1, ...)

Arguments

palette

Palette type. There are three available options:

  • "default" (9-color palette);

  • "light" (9-color light palette);

  • "dark" (9-color dark palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

References

https://news.uchicago.edu/sites/default/files/attachments/_uchicago.identity.guidelines.pdf

Examples

p1 <- example_scatterplot()
p2 <- example_barplot()

p1 + scale_color_uchicago()
p2 + scale_fill_uchicago()

p1 + scale_color_uchicago(palette = "light")
p2 + scale_fill_uchicago(palette = "light")

p1 + scale_color_uchicago(palette = "dark")
p2 + scale_fill_uchicago(palette = "dark")

UCSC Genome Browser color scales

Description

See pal_ucscgb() for details.

Usage

scale_color_ucscgb(palette = c("default"), alpha = 1, ...)

scale_colour_ucscgb(palette = c("default"), alpha = 1, ...)

scale_fill_ucscgb(palette = c("default"), alpha = 1, ...)

Arguments

palette

Palette type. Currently there is one available option: "default" (26-color palette).

alpha

Transparency level, a real number in (0, 1]. See alpha in grDevices::rgb() for details.

...

Additional parameters for ggplot2::discrete_scale().

Author(s)

Nan Xiao | me@nanx.me | https://nanx.me

Examples

example_scatterplot() + scale_color_ucscgb()
example_barplot() + scale_fill_ucscgb()