{"id":13737898,"url":"https://github.com/trevismd/statannotations","last_synced_at":"2025-10-21T19:47:13.106Z","repository":{"id":37041103,"uuid":"296015778","full_name":"trevismd/statannotations","owner":"trevismd","description":"add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.","archived":false,"fork":false,"pushed_at":"2025-03-22T13:36:59.000Z","size":9751,"stargazers_count":746,"open_issues_count":51,"forks_count":76,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-01T05:49:45.240Z","etag":null,"topics":["annotations","plotting","seaborn","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","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/trevismd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-16T11:44:53.000Z","updated_at":"2025-04-30T17:46:49.000Z","dependencies_parsed_at":"2023-01-31T03:16:02.727Z","dependency_job_id":"978ecb61-132b-4086-a30a-7922805d771a","html_url":"https://github.com/trevismd/statannotations","commit_stats":{"total_commits":275,"total_committers":22,"mean_commits":12.5,"dds":0.6290909090909091,"last_synced_commit":"8f148c16944a708dd3d68c9ec4e2772c972fc403"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevismd%2Fstatannotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevismd%2Fstatannotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevismd%2Fstatannotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevismd%2Fstatannotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trevismd","download_url":"https://codeload.github.com/trevismd/statannotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253096212,"owners_count":21853559,"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":["annotations","plotting","seaborn","statistics"],"created_at":"2024-08-03T03:02:05.166Z","updated_at":"2025-10-21T19:47:13.037Z","avatar_url":"https://github.com/trevismd.png","language":"Python","readme":"[![Active Development](https://img.shields.io/badge/Maintenance%20Level-Actively%20Developed-brightgreen.svg)](https://gist.github.com/cheerfulstoic/d107229326a01ff0f333a1d3476e068d) \n![coverage](https://raw.githubusercontent.com/trevismd/statannotations/master/coverage.svg)  \n![Python](https://img.shields.io/badge/Python-3.8%2B-blue)\n[![Documentation Status](https://readthedocs.org/projects/statannotations/badge/?version=latest)](https://statannotations.readthedocs.io/en/master/?badge=latest)\n[![DOI](https://zenodo.org/badge/296015778.svg)](https://zenodo.org/badge/latestdoi/296015778)\n\n## What is it\n\nPython package to optionally compute statistical test and add statistical\nannotations on plots generated with seaborn.\n\n## Features\n\nLatest (v0.7+) : supports pandas v2+ and seaborn v0.12+\n\n- Single function to add statistical annotations on plots\n  generated by seaborn:\n    - Box plots\n    - Bar plots\n    - **Swarm plots**\n    - **Strip plots**\n    - **Violin plots** \n    - Supporting `FacetGrid`\n- Integrated statistical tests (binding to `scipy.stats` methods):\n    - Mann-Whitney\n    - t-test (independent and paired)\n    - Welch's t-test\n    - Levene test\n    - Wilcoxon test\n    - Kruskal-Wallis test\n    - **Brunner-Munzel test**\n- **Interface to use any other function from any source with minimal extra\n  code**\n- Smart layout of multiple annotations with correct y offsets.\n- **Support for vertical and horizontal orientation**\n- Annotations can be located inside or outside the plot.\n- **Corrections for multiple testing can be applied\n  (binding to `statsmodels.stats.multitest.multipletests` methods):**\n    - Bonferroni\n    - Holm-Bonferroni\n    - Benjamini-Hochberg\n    - Benjamini-Yekutieli\n- **And any other function from any source with minimal extra code**\n- Format of the statistical test annotation can be customized:\n      star annotation, simplified p-value format, or explicit p-value.\n- Optionally, custom p-values can be given as input.\n      In this case, no statistical test is performed, but **corrections for\n      multiple testing can be applied.**\n- It is also possible to hide non statistically significant annotations\n- Any text can be used as annotation\n- And various fixes (see\n  [CHANGELOG.md](https://github.com/trevismd/statannotations/blob/master/CHANGELOG.md)).\n\n## Installation\n\nFrom version 0.3.0 on, the package is distributed on PyPi.\nThe latest stable release (v0.7.2) can be downloaded and installed with:\n```bash\npip install statannotations\n```\n\nor, with conda ![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/statannotations) (with ![Python](https://img.shields.io/badge/Python-3.9%2B-blue))\n\n```bash\nconda install -c conda-forge statannotations\n```\n\nor, after cloning the repository,\n```bash\npip install .\n\n# OR, to have optional dependencies too (multiple comparisons \u0026 testing)\npip install -r requirements.txt .\n```\n\n## Usage\n\nHere is a minimal example:\n\n```python\nimport seaborn as sns\n\nfrom statannotations.Annotator import Annotator\n\ndf = sns.load_dataset(\"tips\")\nx = \"day\"\ny = \"total_bill\"\norder = ['Sun', 'Thur', 'Fri', 'Sat']\n\nax = sns.boxplot(data=df, x=x, y=y, order=order)\n\npairs=[(\"Thur\", \"Fri\"), (\"Thur\", \"Sat\"), (\"Fri\", \"Sun\")]\n\nannotator = Annotator(ax, pairs, data=df, x=x, y=y, order=order)\nannotator.configure(test='Mann-Whitney', text_format='star', loc='outside')\nannotator.apply_and_annotate()\n```\n\n## Examples\n\n![Example 2](https://raw.githubusercontent.com/trevismd/statannotations/master/usage/example_hue_layout.png)\n\n![Example 3](https://raw.githubusercontent.com/trevismd/statannotations/master/usage/flu_dataset_log_scale_in_axes.svg)\n\n![Example 4](https://raw.githubusercontent.com/trevismd/statannotations/master/usage/HorizontalBarplotOutside.png)\n\n![Example 5](https://raw.githubusercontent.com/trevismd/statannotations/master/usage/example_2facets.png)\n\n## Documentation\n\n- Usage examples in a jupyter notebook [usage/example.ipynb](https://github.com/trevismd/statannotations/blob/master/usage/example.ipynb),\n- A multipart step-by-step tutorial in a separate [repository](https://github.com/trevismd/statannotations-tutorials) \n  \u0026mdash; [First part here](https://github.com/trevismd/statannotations-tutorials/blob/main/Tutorial_1/Statannotations-Tutorial-1.ipynb),\n  also as a blog post on [Medium](https://levelup.gitconnected.com/statistics-on-seaborn-plots-with-statannotations-2bfce0394c00). \n- *In-progress* sphinx documentation in `/docs`, available on https://statannotations.readthedocs.io/en/latest/index.html\n\n## Requirements\n\n+ Python \u003e= 3.8\n+ numpy \u003e= 1.12.1\n+ seaborn \u003e= 0.9\n+ matplotlib \u003e= 2.2.2\n+ pandas \u003e= 0.23.0\n+ scipy \u003e= 1.1.0\n+ statsmodels (optional, for multiple testing corrections)\n\n\n## Citation\nIf you are using this work, please use the following information to cite it.  \n\nBibtex\n```tex\n@software{florian_charlier_2022_7213391,\n  author       = {Florian Charlier and\n                  Marc Weber and\n                  Dariusz Izak and\n                  Emerson Harkin and\n                  Marcin Magnus and\n                  Joseph Lalli and\n                  Louison Fresnais and\n                  Matt Chan and\n                  Nikolay Markov and\n                  Oren Amsalem and\n                  Sebastian Proost and\n                  Agamemnon Krasoulis and\n                  getzze and\n                  Stefan Repplinger},\n  title        = {Statannotations},\n  month        = oct,\n  year         = 2022,\n  publisher    = {Zenodo},\n  version      = {v0.6},\n  doi          = {10.5281/zenodo.7213391},\n  url          = {https://doi.org/10.5281/zenodo.7213391}\n}\n```\nExample\n```\nFlorian Charlier, Marc Weber, Dariusz Izak, Emerson Harkin, Marcin Magnus, \nJoseph Lalli, Louison Fresnais, Matt Chan, Nikolay Markov, Oren Amsalem, \nSebastian Proost, Agamemnon Krasoulis, getzze, \u0026 Stefan Repplinger. (2022). \nStatannotations (v0.6). Zenodo. https://doi.org/10.5281/zenodo.7213391\n```\n\n## Contributing\n\n**Opening issues and PRs are very much welcome!** (preferably in that order).  \nIn addition to git's history, contributions to statannotations are logged in\nthe changelog.  \nIf you don't know where to start, there may be a few ideas in opened issues or\ndiscussion, or something to work for the documentation.\nNB: More on [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Acknowledgments - Derived work\n\nThis repository is based on\n[webermarcolivier/statannot](https://github.com/webermarcolivier/statannot)\n (commit 1835078 of Feb 21, 2020, tagged \"v0.2.3\").\n\nAdditions/modifications since that version are below represented **in bold**\n(previous fixes are not listed).\n\n**! From version 0.4.0 onwards (introduction of `Annotator`), `statannot`'s API \nis no longer usable in `statannotations`**. \nPlease use the latest v0.3.2 release if you must keep `statannot`'s API in your \ncode, but are looking for bug fixes we have covered.\n\n`statannot`'s interface, at least until its version 0.2.3, is usable in \nstatannotations until v.0.3.x, which already provides additional features (see\ncorresponding branch).\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevismd%2Fstatannotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrevismd%2Fstatannotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevismd%2Fstatannotations/lists"}