{"id":15444373,"url":"https://github.com/jlsteenwyk/ggpubfigs","last_synced_at":"2025-03-15T16:09:46.082Z","repository":{"id":118553887,"uuid":"300004847","full_name":"JLSteenwyk/ggpubfigs","owner":"JLSteenwyk","description":"colorblind friendly color palettes and ggplot2 graphic system extensions for publication-quality scientific figures","archived":false,"fork":false,"pushed_at":"2024-09-03T17:52:17.000Z","size":1735,"stargazers_count":90,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T14:12:37.494Z","etag":null,"topics":["colorblind-friendly","figure","figure-maker","ggplot","ggplot-extension","ggplot2","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JLSteenwyk.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-30T17:49:23.000Z","updated_at":"2024-09-23T15:37:23.000Z","dependencies_parsed_at":"2024-10-31T03:00:47.694Z","dependency_job_id":"a6f8a317-4cfe-4d39-9853-59e38e4906a6","html_url":"https://github.com/JLSteenwyk/ggpubfigs","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":"0.016129032258064502","last_synced_commit":"52797b6bc54acb17691939d5373c79da4ca7cc89"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JLSteenwyk%2Fggpubfigs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JLSteenwyk%2Fggpubfigs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JLSteenwyk%2Fggpubfigs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JLSteenwyk%2Fggpubfigs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JLSteenwyk","download_url":"https://codeload.github.com/JLSteenwyk/ggpubfigs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243754094,"owners_count":20342542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colorblind-friendly","figure","figure-maker","ggplot","ggplot-extension","ggplot2","r"],"created_at":"2024-10-01T19:40:35.573Z","updated_at":"2025-03-15T16:09:46.056Z","avatar_url":"https://github.com/JLSteenwyk.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/logo.png\" alt=\"Logo\" width=\"400\"\u003e\n    \u003cp align=\"center\"\u003e\n        \u003ca href=\"https://github.com/jlsteenwyk/ggpubfigs/graphs/contributors\" alt=\"Contributors\"\u003e\n            \u003cimg src=\"https://img.shields.io/github/contributors/jlsteenwyk/ggpubfigs\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://bsky.app/profile/jlsteenwyk.bsky.social\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n          \u003cimg src=\"https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky\u0026logoColor=fff\"\u003e\n        \u003c/a\u003e\n        \u003cbr /\u003e\n        \u003ca href=\"https://lbesson.mit-license.org/\" alt=\"License\"\u003e\n            \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://journals.asm.org/doi/10.1128/MRA.00871-21\"\u003e\n          \u003cimg src=\"https://zenodo.org/badge/DOI/10.1128/MRA.00871-21.svg\"\u003e\n        \u003c/a\u003e\n    \u003c/p\u003e\n\u003c/p\u003e\n\n**ggpubfigs** is a ggplot2 extension that helps create publication ready figures for the life sciences.\u003cbr /\u003e\nImportantly, ggpubfigs implements themes and color palettes that are both aesthetically pleasing and colorblind friendly.\n\u003cbr /\u003e\u003cbr /\u003e\n\nIf you found ggpubfigs helpful, please cite: *ggpubfigs: Colorblind-Friendly Color Palettes and ggplot2\nGraphic System Extensions for Publication-Quality Scientific\nFigures.* DOI: [10.1128/MRA.00871-21](https://jlsteenwyk.com/publication_pdfs/2021_Steenwyk_and_Rokas_Microbiology_Resource_Announcements.pdf)\n\u003cbr /\u003e\u003cbr /\u003e\n\n---\n\n## Guide\n[Install](#install)\u003cbr /\u003e\n[Quick Start](#quick-start)\u003cbr /\u003e\n[Color palettes](#color-palettes)\u003cbr /\u003e\n[Table of Hex Codes](#table-of-hex-codes)\u003cbr /\u003e\n[Themes](#themes)\u003cbr /\u003e\n[FAQ](#faq)\u003cbr /\u003e\n[Acknowledgements](#acknowledgements)\n\u003cbr /\u003e\u003cbr /\u003e\n\n---\n## Install\n```R\n# execute this command only the first time you use ggpubfigs\ndevtools::install_github(\"JLSteenwyk/ggpubfigs\")\n# load ggpubfigs\nlibrary(ggpubfigs)\n```\n\u003cbr /\u003e\n\n---\n## Quick Start\nThese *quick start* examples demonstrate how to implement two aesthetically pleasing themes and color palettes. \n\n```R\n# using the \"ito_seven\" color palette and theme_big_simple()\nggplot(mtcars, aes(factor(carb), fill=factor(cyl))) + geom_bar() + scale_fill_manual(values = friendly_pal(\"ito_seven\")) + theme_big_simple()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/ito_big_simple.png\" alt=\"ito_simple\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\n# using the \"bright_seven\" color palette and theme_big_grid()\nggplot(mtcars, aes(factor(carb), fill=factor(cyl))) + geom_bar() + scale_fill_manual(values = friendly_pal(\"bright_seven\")) + theme_big_grid()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/bright_big_grid.png\" alt=\"bright_grid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n---\n## Color palettes\nColor palettes are all colorblind friendly. Thus, your figures will be accessible to more people, which is inarguably better for your audience and you. \u003cbr /\u003e\u003cbr /\u003e\nColor palettes are named using the following scheme: *identifier* (underscore) *number of colors in color palette*.\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/friendly_pals.png\" alt=\"friendly_pals\" width=\"400\"\u003e\u003c/p\u003e\n\nTo use these colorblind friendly color palettes, use the following command as an example for both discrete and continuous purposes:\u003cbr /\u003e\n\n```R\nggplot(mtcars, aes(factor(carb), fill=factor(cyl))) + geom_bar() + scale_fill_manual(values = friendly_pal(\"contrast_three\"))\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/contrast_three.png\" alt=\"friendly_pals\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\npal \u003c- friendly_pal(\"contrast_three\", 50, type = \"continuous\")\nimage(volcano, col = pal)\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/contrast_three_volcano.png\" alt=\"friendly_pals\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n---\n## Table of Hex Codes\n| Palettes       | Colors used                                                                     |\n| -------------- | ------------------------------------------------------------------------------- |\n| bright_seven   | #4477AA, #228833, #AA3377, #BBBBBB, #66CCEE, #CCBB44, #EE6677                   |\n| contrast_three | #004488, #BB5566, #DDAA33                                                       |\n| vibrant_seven  | #0077BB, #EE7733, #33BBEE, #CC3311, #009988, #EE3377, #BBBBBB                   |\n| muted_nine     | #332288, #117733, #CC6677, #88CCEE, #999933, #882255, #44AA99, #DDCC77, #AA4499 |\n| nickel_five    | #648FFF, #FE6100, #785EF0, #FFB000, #DC267F                                     |\n| ito_seven      | #0072B2, #D55E00, #009E73, #CC79A7, #56B4E9, #E69F00, #F0E442                   |\n| ibm_five       | #648FFF, #785EF0, #DC267F, #FE6100, #FFB000                                     |\n| wong_eight     | #E69F00, #56B4E9, #009E73, #F0E442, #0072B2, #D55E00, #CC79A7, #000000          |\n| tol_eight      | #332288, #117733, #44AA99, #88CCEE, #DDCC77, #CC6677, #AA4499, #882255          |\n| zesty_four     | #F5793A, #A95AA1, #85C0F9, #0F2080                                              |\n| retro_four     | #601A4A, #EE442F, #63ACBE, #F9F4EC                                              |\n\n\u003cbr /\u003e\n\n---\n## Themes\n### Publication-ready figures \n**theme_grid()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_grid()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/grid.png\" alt=\"Grid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_grid()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/grid_histo.png\" alt=\"Grid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_big_grid()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_big_grid()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/big_grid.png\" alt=\"Grid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_big_grid()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/big_grid_histo.png\" alt=\"Grid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_simple()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_simple()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/simple.png\" alt=\"Simple\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_simple()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/simple_histo.png\" alt=\"Simple\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_big_simple()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_big_simple()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/big_simple.png\" alt=\"Simple\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_big_simple()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/big_simple_histo.png\" alt=\"Simple\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_grey()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_grey()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/grey.png\" alt=\"Grey\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_grey()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/grey_histo.png\" alt=\"Grey\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n### Presentation-ready figures \n**theme_black()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_black()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/black.png\" alt=\"Black\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_black()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/black_histo.png\" alt=\"Black\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_blue()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_blue()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/blue.png\" alt=\"Blue\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_blue()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/blue_histo.png\" alt=\"Blue\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n**theme_red()**\u003cbr /\u003e\n```R\nggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) + geom_point() + theme_red()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/red.png\" alt=\"Red\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n```R\nggplot(iris, aes(Sepal.Length, fill = Species)) + geom_histogram() + theme_red()\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/red_histo.png\" alt=\"Red\" width=\"400\"\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n---\n## FAQ\n**Can I submit color palettes or themes to be incorporated into ggpubfigs?**\u003cbr /\u003e\nYes! Submissions are encouraged, please feel free to contact me via  [twitter](https://twitter.com/jlsteenwyk) or from my [contact information](https://jlsteenwyk.com/contact.html). \n\u003cbr /\u003e\u003cbr /\u003e\n\n---\n## Acknowledgements\nI would like to thank the blooming R community for all the very helpful online forums, discussions, and open source books that have helped me learn R.\u003cbr /\u003e\u003cbr /\u003e\nI would also like to acknowledge that some of the example usage and color palette code was developed based on open source code from the [wes anderson](https://github.com/karthik/wesanderson) color palette package. \n\n\u003c!-- ---\n## Bonus\n\nHere is a tutorial on how to create a violin, boxplot, dot plot hybrid. The function geom_violinhalf() comes from the following [link](https://easystats.github.io/see/reference/geom_violinhalf.html).\n\n```R\nggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +\n    geom_violinhalf() + theme_simple() +\n    scale_fill_manual(values = friendly_pal(\"ito_seven\")) +\n    geom_boxplot(position=position_nudge(x=-.1), width=0.1, outlier.shape=NA) +\n    geom_jitter(alpha=.5, width=.025, size=2)\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JLSteenwyk/ggpubfigs/blob/master/master/docs/_static/violin_boxplot_dotplot_hybrid.png\" alt=\"hybrid\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e --\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlsteenwyk%2Fggpubfigs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlsteenwyk%2Fggpubfigs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlsteenwyk%2Fggpubfigs/lists"}