Type: | Package |
Title: | Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2' |
Version: | 3.2.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, scales |
Suggests: | gridExtra, knitr, ragg, rmarkdown |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-06-17 22:47:29 UTC; nanx |
Author: | Nan Xiao |
Repository: | CRAN |
Date/Publication: | 2024-06-18 00:20:02 UTC |
ggsci: Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2'
Description
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)
Other contributors:
Joshua Cook joshuacook0023@gmail.com [contributor]
Clara Jégousse cat3@hi.is [contributor]
Hui Chen huichen@zju.edu.cn [contributor]
Miaozhu Li miaozhu.li@duke.edu [contributor]
See Also
Useful links:
Report bugs at https://github.com/nanxstats/ggsci/issues
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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))
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
The |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
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))
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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))
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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:
|
n |
Number of individual colors to be generated. |
alpha |
Transparency level, a real number in (0, 1].
See |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_aaas()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
scale_fill_aaas()
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Hui Chen | huichen@zju.edu.cn
References
https://technology.bmj.com/living-style-guide/colour.html
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_bmj()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
reverse |
Logical. Should the order of the colors be reversed? |
... |
Additional parameters for |
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:
The |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Joshua H. Cook | joshuacook0023@gmail.com | @jhrcook
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_cosmic()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
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("ggplot2")
data("diamonds")
p1 <- ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw()
p2 <- ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw()
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Clara Jégousse | cat3@hi.is
Examples
library("ggplot2")
data("diamonds")
p1 <- ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw()
p2 <- ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw()
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Clara Jégousse | cat3@hi.is
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_dark() +
theme(
panel.background = element_rect(fill = "#2D2D2D"),
legend.key = element_rect(fill = "#2D2D2D")
) +
scale_color_frontiers()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_dark() +
theme(
panel.background = 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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_futurama()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
reverse |
Logical. Should the order of the colors be reversed? |
... |
Additional parameters for |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
p1 <- ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw()
p2 <- ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw()
p1 + scale_color_igv()
p2 + scale_fill_igv()
p1 + scale_colour_manual(
values = rep(pal_igv("alternating")(2), times = 3)
)
p2 + scale_fill_manual(
values = rep(pal_igv("alternating")(2), times = 3)
)
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_jama()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_jco()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_lancet()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_locuszoom()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
reverse |
Logical. Should the order of the colors be reversed? |
... |
Additional parameters for |
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_nejm()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_npg()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
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("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_observable()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
scale_fill_observable()
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_rickandmorty()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_simpsons()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_startrek()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_dark() +
theme(
panel.background = element_rect(fill = "#2D2D2D"),
legend.key = element_rect(fill = "#2D2D2D")
) +
scale_color_tron()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_dark() +
theme(
panel.background = 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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
reverse |
Logical. Should the order of the colors be reversed? |
... |
Additional parameters for |
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:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
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("ggplot2")
data("diamonds")
p1 <- ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw()
p2 <- ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw()
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: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Author(s)
Nan Xiao | me@nanx.me | https://nanx.me
Examples
library("ggplot2")
data("diamonds")
ggplot(
subset(diamonds, carat >= 2.2),
aes(x = table, y = price, colour = cut)
) +
geom_point(alpha = 0.7) +
geom_smooth(method = "loess", alpha = 0.1, size = 1, span = 1) +
theme_bw() +
scale_color_ucscgb()
ggplot(
subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
aes(x = depth, fill = cut)
) +
geom_histogram(colour = "black", binwidth = 1, position = "dodge") +
theme_bw() +
scale_fill_ucscgb()