{"id":13665804,"url":"https://github.com/yanlinlin82/ggvenn","last_synced_at":"2026-02-22T10:42:05.324Z","repository":{"id":40409382,"uuid":"188744896","full_name":"yanlinlin82/ggvenn","owner":"yanlinlin82","description":"Venn Diagram by ggplot2, with really easy-to-use API.","archived":false,"fork":false,"pushed_at":"2025-01-27T16:18:42.000Z","size":2964,"stargazers_count":170,"open_issues_count":14,"forks_count":25,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-27T17:29:00.626Z","etag":null,"topics":["easy-to-use","ggplot2","venn-diagram"],"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/yanlinlin82.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-05-27T00:20:33.000Z","updated_at":"2025-01-27T16:18:48.000Z","dependencies_parsed_at":"2023-01-19T02:15:18.599Z","dependency_job_id":"3a354989-1abc-4fb5-a4ef-88e6ada71c16","html_url":"https://github.com/yanlinlin82/ggvenn","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanlinlin82%2Fggvenn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanlinlin82%2Fggvenn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanlinlin82%2Fggvenn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanlinlin82%2Fggvenn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanlinlin82","download_url":"https://codeload.github.com/yanlinlin82/ggvenn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250961033,"owners_count":21514564,"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":["easy-to-use","ggplot2","venn-diagram"],"created_at":"2024-08-02T06:00:51.043Z","updated_at":"2025-10-22T06:20:24.552Z","avatar_url":"https://github.com/yanlinlin82.png","language":"R","funding_links":[],"categories":["R","\u003cspan id=\"head9\"\u003e2.4. Data Visualization\u003c/span\u003e","Plot layers"],"sub_categories":["Venn Diagrams"],"readme":"# ggvenn\n\nVenn Diagram by ggplot2, with really easy-to-use API. This package is inspired by [Venny](http://bioinfogp.cnb.csic.es/tools/venny/index.html)\n\n## Screenshots\n\n\u003ctable width=\"100%\"\u003e\u003ctr\u003e\n\u003ctd\u003e\u003cimg width=\"300\" height=\"300\" src=\"man/figures/venn-2.svg\" alt=\"Venn 2\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg width=\"300\" height=\"300\" src=\"man/figures/venn-3.svg\" alt=\"Venn 3\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg width=\"300\" height=\"300\" src=\"man/figures/venn-4.svg\" alt=\"Venn 4\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Installation\n\n```{r}\ninstall.packages(\"ggvenn\") # install via CRAN\n```\n\nor\n\n```{r}\nif (!require(devtools)) install.packages(\"devtools\")\ndevtools::install_github(\"yanlinlin82/ggvenn\") # install via GitHub (for latest version)\n```\n\n## Quick Start\n\nThis package supports both `list` and `data.frame` type data as input.\n\nFor `list` data (each element is a set):\n\n```{r}\nlibrary(ggvenn)\n\na \u003c- list(`Set 1` = c(1, 3, 5, 7, 9),\n          `Set 2` = c(1, 5, 9, 13),\n          `Set 3` = c(1, 2, 8, 9),\n          `Set 4` = c(6, 7, 10, 12))\nggvenn(a, c(\"Set 1\", \"Set 2\"))            # draw two-set venn\nggvenn(a, c(\"Set 1\", \"Set 2\", \"Set 3\"))   # draw three-set venn\nggvenn(a)   # without set names, the first 4 elements in list will be chose to draw four-set venn\n```\n\nFor `data.frame` data (each logical column is a set):\n\n```{r}\nd \u003c- tibble(value   = c(1,     2,     3,     5,     6,     7,     8,     9),\n            `Set 1` = c(TRUE,  FALSE, TRUE,  TRUE,  FALSE, TRUE,  FALSE, TRUE),\n            `Set 2` = c(TRUE,  FALSE, FALSE, TRUE,  FALSE, FALSE, FALSE, TRUE),\n            `Set 3` = c(TRUE,  TRUE,  FALSE, FALSE, FALSE, FALSE, TRUE,  TRUE),\n            `Set 4` = c(FALSE, FALSE, FALSE, FALSE, TRUE,  TRUE,  FALSE, FALSE))\nggvenn(d, c(\"Set 1\", \"Set 2\"))           # draw two-set venn\nggvenn(d, c(\"Set 1\", \"Set 2\", \"Set 3\"))  # draw three-set venn\nggvenn(d)   # without set names, the first 4 logical column in data.frame will be chose to draw four-set venn\n```\n\nFor `data.frame` data, there is also another way to plot in ggplot grammar:\n\n```{r}\n# draw two-set venn (use A, B in aes)\nggplot(d, aes(A = `Set 1`, B = `Set 2`)) +\n  geom_venn() + theme_void() + coord_fixed()\n\n# draw three-set venn (use A, B, C in aes)\nggplot(d, aes(A = `Set 1`, B = `Set 2`, C = `Set 3`)) +\n  geom_venn() + theme_void() + coord_fixed()\n\n# draw four-set venn (use A, B, C, D in aes)\nggplot(d, aes(A = `Set 1`, B = `Set 2`, C = `Set 3`, D = `Set 4`)) +\n  geom_venn() + theme_void() + coord_fixed()\n```\n\n## More Options\n\nThere are more options for customizing the venn diagram.\n\n1. Tune the color and size\n\n    For filling:\n    \n    * `fill_color` - default is c(\"blue\", \"yellow\", \"green\", \"red\")\n    * `fill_alpha` - default is 0.5\n    \n    For stroke:\n    \n    * `stroke_color` - default is \"black\"\n    * `stroke_alpha` - default is 1\n    * `stroke_size` - default is 1\n    * `stroke_linetype` - default is \"solid\"\n\n    For set name:\n    \n    * `set_name_color` - default is \"black\"\n    * `set_name_size` - default is 6\n\n    For text:\n    \n    * `text_color` - default is \"black\"\n    * `text_size` - default is 4\n\n    All parameters above could be used in both `ggvenn()` and `geom_venn()`.\n    \n    For example:\n    \n    ```{r}\n    a \u003c- list(A = 1:4, B = c(1,3,5))\n    ggvenn(a, stroke_linetype = 2, stroke_size = 0.5,\n      set_name_color = \"red\", set_name_size = 15,\n      fill_color = c(\"pink\", \"gold\"))\n    ```\n\n2. Show elements\n\n    * `show_elements` - default is FALSE\n    * `label_sep` - text used to concatenate elements, default is \",\"\n    \n    For example:\n    \n    ```{r}\n    a \u003c- list(A = c(\"apple\", \"pear\", \"peach\"),\n              B = c(\"apple\", \"lemon\"))\n    ggvenn(a, show_elements = TRUE)\n    \n    ggvenn(a, show_elements = TRUE, label_sep = \"\\n\")  # show elements in line\n    ```\n\n3. Hide percentage\n\n    * `show_percentage` - default is TRUE\n\n    For example:\n    \n    ```{r}\n    a \u003c- list(A = 1:5, B = 1:2)\n    ggvenn(a, show_percentage = FALSE)\n    ```\n\n4. Change digits of percentage\n\n    * `digits` - default is 1\n\n    For example:\n    \n    ```{r}\n    a \u003c- list(A = 1:5, B = 1:2)\n    ggvenn(a, digits = 2)\n    ```\n\n## Data Format\n\nThe `ggvenn` support two types of input data: list and data.frame. Two functions (`data_frame_to_list()` and `list_to_data_frame()`) can convert data between the two types.\n\n```r\na \u003c- list(A = 1:5, B = 4:6)\nd \u003c- tibble(key = 1:6,\n            A = c(rep(TRUE, 5), FALSE),\n            B = rep(c(FALSE, TRUE), each = 3))\n\nidentical(a, data_frame_to_list(d))  # TRUE\nidentical(d, list_to_data_frame(a))  # TRUE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanlinlin82%2Fggvenn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanlinlin82%2Fggvenn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanlinlin82%2Fggvenn/lists"}