Title: | 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. |
Authors: | Nan Xiao [aut, cre] , Joshua Cook [ctb], Clara Jégousse [ctb], Hui Chen [ctb], Miaozhu Li [ctb] |
Maintainer: | Nan Xiao <[email protected]> |
License: | GPL (>= 3) |
Version: | 3.2.0 |
Built: | 2024-11-14 04:44:43 UTC |
Source: | https://github.com/nanxstats/ggsci |
Color palettes inspired by plots in journals published by American Association for the Advancement of Science (AAAS), such as Science and Science Translational Medicine.
pal_aaas(palette = c("default"), alpha = 1)
pal_aaas(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_aaas("default")(10)) show_col(pal_aaas("default", alpha = 0.6)(10))
library("scales") show_col(pal_aaas("default")(10)) show_col(pal_aaas("default", alpha = 0.6)(10))
Color palette from the BMJ living style guide.
pal_bmj(palette = c("default"), alpha = 1)
pal_bmj(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Hui Chen | [email protected]
https://technology.bmj.com/living-style-guide/colour.html
library("scales") show_col(pal_bmj("default")(9)) show_col(pal_bmj("default", alpha = 0.6)(9))
library("scales") show_col(pal_bmj("default")(9)) show_col(pal_bmj("default", alpha = 0.6)(9))
Bootstrap 5 color palettes.
pal_bs5( palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", "gray"), n = 10, alpha = 1, reverse = FALSE )
pal_bs5( palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", "gray"), n = 10, alpha = 1, reverse = FALSE )
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? |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_bs5("indigo")(10)) show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_bs5("indigo")(10)) show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
Color palettes inspired by the colors used in projects from the Catalogue Of Somatic Mutations in Cancers (COSMIC).
pal_cosmic( palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), alpha = 1 )
pal_cosmic( palette = c("hallmarks_light", "hallmarks_dark", "signature_substitutions"), alpha = 1 )
palette |
Palette type. Currently there are three available options:
The |
alpha |
Transparency level, a real number in (0, 1].
See |
Joshua H. Cook | [email protected] | @jhrcook
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))
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))
Color palettes based on the colors used by D3.js.
pal_d3( palette = c("category10", "category20", "category20b", "category20c"), alpha = 1 )
pal_d3( palette = c("category10", "category20", "category20b", "category20c"), alpha = 1 )
palette |
Palette type. There are four available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md
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))
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))
Color palettes inspired by the Flat UI colors.
pal_flatui(palette = c("default", "flattastic", "aussie"), alpha = 1)
pal_flatui(palette = c("default", "flattastic", "aussie"), alpha = 1)
palette |
Palette type. Currently there are three available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
Clara Jégousse | [email protected]
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))
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))
Color palettes inspired by the colors used in Frontiers journals.
pal_frontiers(palette = c("default"), alpha = 1)
pal_frontiers(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Clara Jégousse | [email protected]
library("scales") show_col(pal_frontiers("default")(7)) show_col(pal_frontiers("default", alpha = 0.6)(7))
library("scales") show_col(pal_frontiers("default")(7)) show_col(pal_frontiers("default", alpha = 0.6)(7))
Color palettes inspired by the colors used in Futurama.
pal_futurama(palette = c("planetexpress"), alpha = 1)
pal_futurama(palette = c("planetexpress"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_futurama("planetexpress")(12)) show_col(pal_futurama("planetexpress", alpha = 0.6)(12))
library("scales") show_col(pal_futurama("planetexpress")(12)) show_col(pal_futurama("planetexpress", alpha = 0.6)(12))
Color palette inspired by the colors used in the heatmaps plotted by GSEA GenePattern.
pal_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
pal_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
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? |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_gsea("default")(12)) show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_gsea("default")(12)) show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))
Color palettes based on the colors used by Integrative Genomics Viewer (IGV).
pal_igv(palette = c("default", "alternating"), alpha = 1)
pal_igv(palette = c("default", "alternating"), alpha = 1)
palette |
Palette type. There are two available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
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).
library("scales") show_col(pal_igv("default")(51)) show_col(pal_igv("alternating")(2))
library("scales") show_col(pal_igv("default")(51)) show_col(pal_igv("alternating")(2))
Color palette inspired by plots in The Journal of the American Medical Association.
pal_jama(palette = c("default"), alpha = 1)
pal_jama(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_jama("default")(7)) show_col(pal_jama("default", alpha = 0.6)(7))
library("scales") show_col(pal_jama("default")(7)) show_col(pal_jama("default", alpha = 0.6)(7))
Color palette inspired by plots in Journal of Clinical Oncology.
pal_jco(palette = c("default"), alpha = 1)
pal_jco(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_jco("default")(10)) show_col(pal_jco("default", alpha = 0.6)(10))
library("scales") show_col(pal_jco("default")(10)) show_col(pal_jco("default", alpha = 0.6)(10))
Color palettes inspired by plots in Lancet journals, such as Lancet Oncology.
pal_lancet(palette = c("lanonc"), alpha = 1)
pal_lancet(palette = c("lanonc"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_lancet("lanonc")(9)) show_col(pal_lancet("lanonc", alpha = 0.6)(9))
library("scales") show_col(pal_lancet("lanonc")(9)) show_col(pal_lancet("lanonc", alpha = 0.6)(9))
Color palettes based on the colors used by LocusZoom.
pal_locuszoom(palette = c("default"), alpha = 1)
pal_locuszoom(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
Pruim, Randall J., et al. (2010). LocusZoom: regional visualization of genome-wide association scan results. Bioinformatics, 26(18), 2336–2337.
library("scales") show_col(pal_locuszoom("default")(7)) show_col(pal_locuszoom("default", alpha = 0.6)(7))
library("scales") show_col(pal_locuszoom("default")(7)) show_col(pal_locuszoom("default", alpha = 0.6)(7))
Material Design 2 color palettes.
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 )
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 )
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? |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_material("indigo")(10)) show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_material("indigo")(10)) show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
Color palette inspired by plots in The New England Journal of Medicine.
pal_nejm(palette = c("default"), alpha = 1)
pal_nejm(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_nejm("default")(8)) show_col(pal_nejm("default", alpha = 0.6)(8))
library("scales") show_col(pal_nejm("default")(8)) show_col(pal_nejm("default", alpha = 0.6)(8))
Color palettes inspired by plots in journals published by Nature Publishing Group, such as Nature Reviews Cancer.
pal_npg(palette = c("nrc"), alpha = 1)
pal_npg(palette = c("nrc"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_npg("nrc")(10)) show_col(pal_npg("nrc", alpha = 0.6)(10))
library("scales") show_col(pal_npg("nrc")(10)) show_col(pal_npg("nrc", alpha = 0.6)(10))
The Observable 10 palette.
pal_observable(palette = c("observable10"), alpha = 1)
pal_observable(palette = c("observable10"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
Pettiross J (2023). "Crafting data colors and staying on brand." Observable blog. https://observablehq.com/blog/crafting-data-colors
library("scales") show_col(pal_observable("observable10")(10)) show_col(pal_observable("observable10", alpha = 0.6)(10))
library("scales") show_col(pal_observable("observable10")(10)) show_col(pal_observable("observable10", alpha = 0.6)(10))
Color palettes inspired by the colors used in Rick and Morty.
pal_rickandmorty(palette = c("schwifty"), alpha = 1)
pal_rickandmorty(palette = c("schwifty"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_rickandmorty("schwifty")(12)) show_col(pal_rickandmorty("schwifty", alpha = 0.6)(12))
library("scales") show_col(pal_rickandmorty("schwifty")(12)) show_col(pal_rickandmorty("schwifty", alpha = 0.6)(12))
Color palettes inspired by the colors used in The Simpsons.
pal_simpsons(palette = c("springfield"), alpha = 1)
pal_simpsons(palette = c("springfield"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_simpsons("springfield")(16)) show_col(pal_simpsons("springfield", alpha = 0.6)(16))
library("scales") show_col(pal_simpsons("springfield")(16)) show_col(pal_simpsons("springfield", alpha = 0.6)(16))
Color palettes inspired by the colors used in Star Trek.
pal_startrek(palette = c("uniform"), alpha = 1)
pal_startrek(palette = c("uniform"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_startrek("uniform")(7)) show_col(pal_startrek("uniform", alpha = 0.6)(7))
library("scales") show_col(pal_startrek("uniform")(7)) show_col(pal_startrek("uniform", alpha = 0.6)(7))
Color palettes inspired by the colors used in Tron Legacy.
pal_tron(palette = c("legacy"), alpha = 1)
pal_tron(palette = c("legacy"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_tron("legacy")(7)) show_col(pal_tron("legacy", alpha = 0.6)(7))
library("scales") show_col(pal_tron("legacy")(7)) show_col(pal_tron("legacy", alpha = 0.6)(7))
Tailwind CSS color palettes.
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 )
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 )
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? |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_tw3("rose")(10)) show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_tw3("rose")(10)) show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))
Color palettes based on the colors used by the University of Chicago.
pal_uchicago(palette = c("default", "light", "dark"), alpha = 1)
pal_uchicago(palette = c("default", "light", "dark"), alpha = 1)
palette |
Palette type. There are three available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
https://news.uchicago.edu/sites/default/files/attachments/_uchicago.identity.guidelines.pdf
library("scales") show_col(pal_uchicago("default")(9)) show_col(pal_uchicago("light")(9)) show_col(pal_uchicago("dark")(9))
library("scales") show_col(pal_uchicago("default")(9)) show_col(pal_uchicago("light")(9)) show_col(pal_uchicago("dark")(9))
Color palette from UCSC Genome Browser chromosome colors.
pal_ucscgb(palette = c("default"), alpha = 1)
pal_ucscgb(palette = c("default"), alpha = 1)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_ucscgb("default")(26)) show_col(pal_ucscgb("default", alpha = 0.6)(26))
library("scales") show_col(pal_ucscgb("default")(26)) show_col(pal_ucscgb("default", alpha = 0.6)(26))
Bootstrap 5 color palettes.
rgb_bs5( palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", "gray"), n = 10, alpha = 1, reverse = FALSE )
rgb_bs5( palette = c("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", "gray"), n = 10, alpha = 1, reverse = FALSE )
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? |
Nan Xiao | [email protected] | https://nanx.me
https://getbootstrap.com/docs/5.3/customize/color/#all-colors
library("scales") show_col(pal_bs5("indigo")(10)) show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_bs5("indigo")(10)) show_col(pal_bs5("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
Color palette inspired by the colors used in the heatmaps plotted by GSEA GenePattern.
rgb_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
rgb_gsea(palette = c("default"), n = 12, alpha = 1, reverse = FALSE)
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? |
The 12 base colors used in this palette are derived from the HeatMapImage documentation.
Nan Xiao | [email protected] | https://nanx.me
library("scales") show_col(pal_gsea("default")(12)) show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_gsea("default")(12)) show_col(pal_gsea("default", n = 30, alpha = 0.6, reverse = TRUE)(30))
Material Design 2 color palettes.
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 )
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 )
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? |
Nan Xiao | [email protected] | https://nanx.me
https://m2.material.io/design/color/the-color-system.html
library("scales") show_col(pal_material("indigo")(10)) show_col(pal_material("indigo", n = 30, alpha = 0.6, reverse = TRUE)(30))
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.
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 )
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 )
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? |
Nan Xiao | [email protected] | https://nanx.me
https://tailwindcss.com/docs/customizing-colors
library("scales") show_col(pal_tw3("rose")(10)) show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))
library("scales") show_col(pal_tw3("rose")(10)) show_col(pal_tw3("rose", n = 30, alpha = 0.6, reverse = TRUE)(30))
See pal_aaas()
for details.
scale_color_aaas(palette = c("default"), alpha = 1, ...) scale_colour_aaas(palette = c("default"), alpha = 1, ...) scale_fill_aaas(palette = c("default"), alpha = 1, ...)
scale_color_aaas(palette = c("default"), alpha = 1, ...) scale_colour_aaas(palette = c("default"), alpha = 1, ...) scale_fill_aaas(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_bmj()
for details.
scale_color_bmj(palette = c("default"), alpha = 1, ...) scale_colour_bmj(palette = c("default"), alpha = 1, ...) scale_fill_bmj(palette = c("default"), alpha = 1, ...)
scale_color_bmj(palette = c("default"), alpha = 1, ...) scale_colour_bmj(palette = c("default"), alpha = 1, ...) scale_fill_bmj(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Hui Chen | [email protected]
https://technology.bmj.com/living-style-guide/colour.html
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()
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()
See pal_bs5()
for details.
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, ... )
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, ... )
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 |
Nan Xiao | [email protected] | https://nanx.me
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")
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")
See pal_cosmic()
for details.
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, ... )
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, ... )
palette |
Palette type. Currently there are three available options:
The |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Joshua H. Cook | [email protected] | @jhrcook
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()
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()
See pal_d3()
for details.
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, ... )
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, ... )
palette |
Palette type. There are four available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md
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")
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")
See pal_flatui()
for details.
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, ... )
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, ... )
palette |
Palette type. Currently there are three available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Clara Jégousse | [email protected]
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")
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")
See pal_frontiers()
for details.
scale_color_frontiers(palette = c("default"), alpha = 1, ...) scale_colour_frontiers(palette = c("default"), alpha = 1, ...) scale_fill_frontiers(palette = c("default"), alpha = 1, ...)
scale_color_frontiers(palette = c("default"), alpha = 1, ...) scale_colour_frontiers(palette = c("default"), alpha = 1, ...) scale_fill_frontiers(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Clara Jégousse | [email protected]
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()
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()
See pal_futurama()
for details.
scale_color_futurama(palette = c("planetexpress"), alpha = 1, ...) scale_colour_futurama(palette = c("planetexpress"), alpha = 1, ...) scale_fill_futurama(palette = c("planetexpress"), alpha = 1, ...)
scale_color_futurama(palette = c("planetexpress"), alpha = 1, ...) scale_colour_futurama(palette = c("planetexpress"), alpha = 1, ...) scale_fill_futurama(palette = c("planetexpress"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_gsea()
for details.
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, ...)
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, ...)
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 |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_igv()
for details.
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, ...)
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, ...)
palette |
Palette type. There are two available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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) )
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) )
See pal_jama()
for details.
scale_color_jama(palette = c("default"), alpha = 1, ...) scale_colour_jama(palette = c("default"), alpha = 1, ...) scale_fill_jama(palette = c("default"), alpha = 1, ...)
scale_color_jama(palette = c("default"), alpha = 1, ...) scale_colour_jama(palette = c("default"), alpha = 1, ...) scale_fill_jama(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_jco()
for details.
scale_color_jco(palette = c("default"), alpha = 1, ...) scale_colour_jco(palette = c("default"), alpha = 1, ...) scale_fill_jco(palette = c("default"), alpha = 1, ...)
scale_color_jco(palette = c("default"), alpha = 1, ...) scale_colour_jco(palette = c("default"), alpha = 1, ...) scale_fill_jco(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_lancet()
for details.
scale_color_lancet(palette = c("lanonc"), alpha = 1, ...) scale_colour_lancet(palette = c("lanonc"), alpha = 1, ...) scale_fill_lancet(palette = c("lanonc"), alpha = 1, ...)
scale_color_lancet(palette = c("lanonc"), alpha = 1, ...) scale_colour_lancet(palette = c("lanonc"), alpha = 1, ...) scale_fill_lancet(palette = c("lanonc"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_locuszoom()
for details.
scale_color_locuszoom(palette = c("default"), alpha = 1, ...) scale_colour_locuszoom(palette = c("default"), alpha = 1, ...) scale_fill_locuszoom(palette = c("default"), alpha = 1, ...)
scale_color_locuszoom(palette = c("default"), alpha = 1, ...) scale_colour_locuszoom(palette = c("default"), alpha = 1, ...) scale_fill_locuszoom(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_material()
for details.
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, ... )
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, ... )
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 |
Nan Xiao | [email protected] | https://nanx.me
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")
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")
See pal_nejm()
for details.
scale_color_nejm(palette = c("default"), alpha = 1, ...) scale_colour_nejm(palette = c("default"), alpha = 1, ...) scale_fill_nejm(palette = c("default"), alpha = 1, ...)
scale_color_nejm(palette = c("default"), alpha = 1, ...) scale_colour_nejm(palette = c("default"), alpha = 1, ...) scale_fill_nejm(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_npg()
for details.
scale_color_npg(palette = c("nrc"), alpha = 1, ...) scale_colour_npg(palette = c("nrc"), alpha = 1, ...) scale_fill_npg(palette = c("nrc"), alpha = 1, ...)
scale_color_npg(palette = c("nrc"), alpha = 1, ...) scale_colour_npg(palette = c("nrc"), alpha = 1, ...) scale_fill_npg(palette = c("nrc"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_observable()
for details.
scale_color_observable(palette = c("observable10"), alpha = 1, ...) scale_colour_observable(palette = c("observable10"), alpha = 1, ...) scale_fill_observable(palette = c("observable10"), alpha = 1, ...)
scale_color_observable(palette = c("observable10"), alpha = 1, ...) scale_colour_observable(palette = c("observable10"), alpha = 1, ...) scale_fill_observable(palette = c("observable10"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
Pettiross J (2023). "Crafting data colors and staying on brand." Observable blog. https://observablehq.com/blog/crafting-data-colors
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()
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()
See pal_rickandmorty()
for details.
scale_color_rickandmorty(palette = c("schwifty"), alpha = 1, ...) scale_colour_rickandmorty(palette = c("schwifty"), alpha = 1, ...) scale_fill_rickandmorty(palette = c("schwifty"), alpha = 1, ...)
scale_color_rickandmorty(palette = c("schwifty"), alpha = 1, ...) scale_colour_rickandmorty(palette = c("schwifty"), alpha = 1, ...) scale_fill_rickandmorty(palette = c("schwifty"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_simpsons()
for details.
scale_color_simpsons(palette = c("springfield"), alpha = 1, ...) scale_colour_simpsons(palette = c("springfield"), alpha = 1, ...) scale_fill_simpsons(palette = c("springfield"), alpha = 1, ...)
scale_color_simpsons(palette = c("springfield"), alpha = 1, ...) scale_colour_simpsons(palette = c("springfield"), alpha = 1, ...) scale_fill_simpsons(palette = c("springfield"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_startrek()
for details.
scale_color_startrek(palette = c("uniform"), alpha = 1, ...) scale_colour_startrek(palette = c("uniform"), alpha = 1, ...) scale_fill_startrek(palette = c("uniform"), alpha = 1, ...)
scale_color_startrek(palette = c("uniform"), alpha = 1, ...) scale_colour_startrek(palette = c("uniform"), alpha = 1, ...) scale_fill_startrek(palette = c("uniform"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_tron()
for details.
scale_color_tron(palette = c("legacy"), alpha = 1, ...) scale_colour_tron(palette = c("legacy"), alpha = 1, ...) scale_fill_tron(palette = c("legacy"), alpha = 1, ...)
scale_color_tron(palette = c("legacy"), alpha = 1, ...) scale_colour_tron(palette = c("legacy"), alpha = 1, ...) scale_fill_tron(palette = c("legacy"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()
See pal_tw3()
for details.
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, ... )
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, ... )
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 |
Nan Xiao | [email protected] | https://nanx.me
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")
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")
See pal_uchicago()
for details.
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, ...)
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, ...)
palette |
Palette type. There are three available options:
|
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
https://news.uchicago.edu/sites/default/files/attachments/_uchicago.identity.guidelines.pdf
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")
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")
See pal_ucscgb()
for details.
scale_color_ucscgb(palette = c("default"), alpha = 1, ...) scale_colour_ucscgb(palette = c("default"), alpha = 1, ...) scale_fill_ucscgb(palette = c("default"), alpha = 1, ...)
scale_color_ucscgb(palette = c("default"), alpha = 1, ...) scale_colour_ucscgb(palette = c("default"), alpha = 1, ...) scale_fill_ucscgb(palette = c("default"), alpha = 1, ...)
palette |
Palette type.
Currently there is one available option: |
alpha |
Transparency level, a real number in (0, 1].
See |
... |
Additional parameters for |
Nan Xiao | [email protected] | https://nanx.me
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()
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()