{"id":14977303,"url":"https://github.com/botprof/plotting-uncertainty-ellipses","last_synced_at":"2025-10-28T03:30:48.298Z","repository":{"id":166423617,"uuid":"303839032","full_name":"botprof/plotting-uncertainty-ellipses","owner":"botprof","description":"This Jupyter notebook demonstrates how to properly plot uncertainty (confidence) ellipses for 2D normally distributed data.","archived":false,"fork":false,"pushed_at":"2023-07-29T19:08:25.000Z","size":2327,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T10:41:35.788Z","etag":null,"topics":["confidence-ellipse","ipynb","jupyter-notebook","matplotlib","normal-distribution","plot","plotting","plotting-uncertainty-ellipses","python","sample-ellipse","statistics","uncertainty","uncertainty-estimation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botprof.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":"2020-10-13T22:03:53.000Z","updated_at":"2024-09-28T14:00:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"f81a6fd5-935e-45c7-a1e5-c34b228da8e0","html_url":"https://github.com/botprof/plotting-uncertainty-ellipses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botprof%2Fplotting-uncertainty-ellipses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botprof%2Fplotting-uncertainty-ellipses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botprof%2Fplotting-uncertainty-ellipses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botprof%2Fplotting-uncertainty-ellipses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botprof","download_url":"https://codeload.github.com/botprof/plotting-uncertainty-ellipses/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590593,"owners_count":19497351,"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":["confidence-ellipse","ipynb","jupyter-notebook","matplotlib","normal-distribution","plot","plotting","plotting-uncertainty-ellipses","python","sample-ellipse","statistics","uncertainty","uncertainty-estimation"],"created_at":"2024-09-24T13:55:25.912Z","updated_at":"2025-10-28T03:30:47.835Z","avatar_url":"https://github.com/botprof.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to Properly Plot Uncertainty Ellipses for 2D Normally Distributed Data\n\nThis notebook demonstrates how to properly plot ellipses that represent desired levels of uncertainty as given by the covariance matrix of normally distributed data in 2D.  The reason for this note is that I have seen others naively extend 1D covariance bounds to 2D, which is not technically correct.  The example is written in Python and uses [Matplotlib](https://matplotlib.org).\n\n## Main Files\n\n* [plotting-uncertainty-ellipses.ipynb](https://github.com/botprof/plotting-uncertainty-ellipses/blob/main/plotting-uncertainty-ellipses.ipynb) (Jupyter notebook)\n\n## Sample Output\n\nHere is an example 95 \\% confidence ellipse for 1000 sample points.\n\n![Sample ellipse](sample-ellipse.svg)\n\n## References\n\nYou can find a similar but partial treatment of this problem on the Matplotlib page called [\"Plot a confidence ellipse of a two-dimensional dataset\"](https://matplotlib.org/devdocs/gallery/statistics/confidence_ellipse.html). Vincent Spruyt also has a really nice and complete description on his page called [\"How to draw a covariance error ellipse?\"](https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/). We also employ the book Johnson and Wichern (2007) [Applied Multivariate Statistical Anlaysis](https://ocul-qu.primo.exlibrisgroup.com/permalink/01OCUL_QU/11tsvcl/alma9925738833405158) (6th ed.), Chapter 4, Result 4.7 on page 163.\n\n## Cite this Work\n\nYou may wish to cite this work in your publications.\n\n\u003e Joshua A. Marshall, How to Properly Plot Uncertainty Ellipses for 2D Normally Distributed Data, 2020, URL: [https://github.com/botprof/plotting-uncertainty-ellipses](https://github.com/botprof/plotting-uncertainty-ellipses).\n\nYou might also use the BibTeX entry below.\n\n```latex\n@misc{Marshall2020,\n  author = {Marshall, Joshua A.},\n  title = {How to Properly Plot Uncertainty Ellipses for 2D Normally Distributed Data},\n  year = {2020},\n  howpublished = {\\url{https://github.com/botprof/plotting-uncertainty-ellipses}}\n}\n```\n\n## License\n\nSource code examples in this notebook are subject to an [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotprof%2Fplotting-uncertainty-ellipses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotprof%2Fplotting-uncertainty-ellipses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotprof%2Fplotting-uncertainty-ellipses/lists"}