{"id":13504974,"url":"https://github.com/tidyverse/ggplot2","last_synced_at":"2026-03-17T21:34:06.347Z","repository":{"id":401121,"uuid":"19438","full_name":"tidyverse/ggplot2","owner":"tidyverse","description":"An implementation of the Grammar of Graphics in R","archived":false,"fork":false,"pushed_at":"2026-02-20T22:19:37.000Z","size":1310320,"stargazers_count":6885,"open_issues_count":106,"forks_count":2134,"subscribers_count":295,"default_branch":"main","last_synced_at":"2026-03-15T12:52:55.333Z","etag":null,"topics":["data-visualisation","r","visualisation"],"latest_commit_sha":null,"homepage":"https://ggplot2.tidyverse.org","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/tidyverse.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2008-05-25T01:21:32.000Z","updated_at":"2026-03-15T02:46:03.000Z","dependencies_parsed_at":"2023-07-05T14:47:55.665Z","dependency_job_id":"2b0067d8-cadb-4169-be32-eeaf8285469a","html_url":"https://github.com/tidyverse/ggplot2","commit_stats":{"total_commits":5000,"total_committers":343,"mean_commits":"14.577259475218659","dds":0.5449999999999999,"last_synced_commit":"679ff96bcd04444e4738df5f2717d462d73934be"},"previous_names":["hadley/ggplot2"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/tidyverse/ggplot2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fggplot2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fggplot2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fggplot2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fggplot2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidyverse","download_url":"https://codeload.github.com/tidyverse/ggplot2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fggplot2/sbom","scorecard":{"id":884863,"data":{"date":"2025-08-11","repo":{"name":"github.com/tidyverse/ggplot2","commit":"bed8e32d45c7dc98afb783b409edac98854d41a7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.8,"checks":[{"name":"Maintained","score":10,"reason":"29 commit(s) and 26 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":9,"reason":"Found 29/30 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pkgdown.yaml:25","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pr-commands.yaml:19","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pr-commands.yaml:58","Info: topLevel permissions set to 'read-all': .github/workflows/R-CMD-check.yaml:15","Info: topLevel permissions set to 'read-all': .github/workflows/pkgdown.yaml:14","Info: topLevel permissions set to 'read-all': .github/workflows/pr-commands.yaml:9","Info: topLevel permissions set to 'read-all': .github/workflows/test-coverage.yaml:11"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/R-CMD-check.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pkgdown.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/test-coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/tidyverse/ggplot2/test-coverage.yaml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  18 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T09:36:18.729Z","repository_id":401121,"created_at":"2025-08-24T09:36:18.730Z","updated_at":"2025-08-24T09:36:18.730Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30631991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-visualisation","r","visualisation"],"created_at":"2024-08-01T00:00:55.756Z","updated_at":"2026-03-17T21:34:06.328Z","avatar_url":"https://github.com/tidyverse.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r}\n#| echo: false\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# ggplot2 \u003ca href=\"https://ggplot2.tidyverse.org\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" alt=\"ggplot2 website\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)\n[![Codecov test coverage](https://codecov.io/gh/tidyverse/ggplot2/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\nggplot2 is a system for declaratively creating graphics, based on [The Grammar of Graphics][gg-book]. You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.\n\n## Installation\n\n```{r}\n#| eval: false\n# The easiest way to get ggplot2 is to install the whole tidyverse:\ninstall.packages(\"tidyverse\")\n\n# Alternatively, install just ggplot2:\ninstall.packages(\"ggplot2\")\n\n# Or the development version from GitHub:\n# install.packages(\"pak\")\npak::pak(\"tidyverse/ggplot2\")\n```\n\n## Cheatsheet\n\n\u003ca href=\"https://github.com/rstudio/cheatsheets/blob/master/data-visualization.pdf\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/data-visualization-cheatsheet-thumbs.png\" width=\"630\" height=\"252\" alt=\"ggplot2 cheatsheet\" /\u003e\u003c/a\u003e\n\n## Usage\n\nIt's hard to succinctly describe how ggplot2 works because it embodies a deep philosophy of visualisation. However, in most cases you start with `ggplot()`, supply a dataset and aesthetic mapping (with `aes()`). You then add on layers (like `geom_point()` or `geom_histogram()`), scales (like `scale_colour_brewer()`), faceting specifications (like `facet_wrap()`) and coordinate systems (like `coord_flip()`).\n\n```{r}\n#| label: example\n#| fig.alt: \"Scatterplot of engine displacement versus highway miles per\n#|  gallon, for 234 cars coloured by 7 'types' of car. The displacement and miles\n#|  per gallon are inversely correlated.\"\nlibrary(ggplot2)\n\nggplot(mpg, aes(displ, hwy, colour = class)) +\n  geom_point()\n```\n\n\n## Lifecycle\n\n[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n\nggplot2 is now over 10 years old and is used by hundreds of thousands of people to make millions of plots. That means, by-and-large, ggplot2 itself changes relatively little. When we do make changes, they will be generally to add new functions or arguments rather than changing the behaviour of existing functions, and if we do make changes to existing behaviour we will do them for compelling reasons.\n\nIf you are looking for innovation, look to ggplot2's rich ecosystem of extensions. See a community maintained list at \u003chttps://exts.ggplot2.tidyverse.org/gallery/\u003e.\n\n## Learning ggplot2\n\nIf you are new to ggplot2 you are better off starting with a systematic introduction, rather than trying to learn from reading individual documentation pages. Currently, there are several good places to start:\n\n1.  The [Data Visualization][r4ds-vis] and\n    [Communication][r4ds-comm] chapters in\n    [R for Data Science][r4ds]. R for Data Science is designed to\n    give you a comprehensive introduction to the\n    [tidyverse](https://www.tidyverse.org), and these two chapters will\n    get you up to speed with the essentials of ggplot2 as quickly as\n    possible.\n\n1.  If you'd like to take an online course, try\n    [Data Visualization in R With ggplot2][oreilly] by Kara Woo.\n\n1.  If you'd like to follow a webinar, try\n    [Plotting Anything with ggplot2](https://youtu.be/h29g21z0a68) by Thomas Lin\n    Pedersen.\n\n1.  If you want to dive into making common graphics as quickly\n    as possible, I recommend [The R Graphics Cookbook][cookbook]\n    by Winston Chang. It provides a set of recipes to solve common\n    graphics problems.\n\n1.  If you've mastered the basics and want to learn more, read [ggplot2: Elegant Graphics for Data Analysis][ggplot2-book].\n    It describes the theoretical underpinnings of ggplot2 and shows you how all the pieces fit together.\n    This book helps you understand the theory that underpins ggplot2,\n    and will help you create new types of graphics specifically tailored to your needs.\n\n1.  For articles about announcements and deep-dives you can visit the [tidyverse blog][blog].\n\n## Getting help\n\nThere are two main places to get help with ggplot2:\n\n1.  The [RStudio community][community] is a friendly place to ask any\n    questions about ggplot2.\n\n1.  [Stack Overflow][so] is a great source of answers to common ggplot2\n    questions. It is also a great place to get help, once you have\n    created a reproducible example that illustrates your problem.\n\n[community]: https://forum.posit.co/\n[ggplot2-book]: https://ggplot2-book.org\n[gg-book]: https://link.springer.com/book/10.1007/0-387-28695-0\n[so]: https://stackoverflow.com/questions/tagged/ggplot2?sort=frequent\u0026pageSize=50\n[cookbook]: https://r-graphics.org\n[r4ds]: https://r4ds.hadley.nz\n[r4ds-vis]: https://r4ds.hadley.nz/data-visualize\n[r4ds-comm]: https://r4ds.hadley.nz/communication\n[oreilly]: https://learning.oreilly.com/videos/data-visualization-in/9781491963661/\n[blog]: https://www.tidyverse.org/tags/ggplot2/\n","funding_links":[],"categories":["Visualization","Figures","R","Industrial Strength Visualisation libraries","Generate TLG","Visualisation libraries","[R](#r)","Data Visualization","Industry Strength Visualisation","其他_机器学习与深度学习","Table of Contents"],"sub_categories":["Packages","R packages","Graphs","Data Management","Visualization"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Fggplot2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidyverse%2Fggplot2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Fggplot2/lists"}