{"id":18336102,"url":"https://github.com/tpvasconcelos/ridgeplot","last_synced_at":"2025-04-04T16:12:26.967Z","repository":{"id":37002315,"uuid":"331715948","full_name":"tpvasconcelos/ridgeplot","owner":"tpvasconcelos","description":"Beautiful ridgeline plots in Python","archived":false,"fork":false,"pushed_at":"2024-10-17T01:12:58.000Z","size":7892,"stargazers_count":65,"open_issues_count":12,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-17T06:24:24.438Z","etag":null,"topics":["data-analysis","data-science","data-visualization","distplot","ggridges","graphing","joyplot","plot","plotly","plotting","python","ridgeline","visualization"],"latest_commit_sha":null,"homepage":"https://ridgeplot.readthedocs.io/","language":"Python","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/tpvasconcelos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-21T18:21:30.000Z","updated_at":"2024-10-17T01:03:57.000Z","dependencies_parsed_at":"2023-12-29T15:24:09.056Z","dependency_job_id":"fdfc91de-b65d-455c-bc6f-d614019aa87a","html_url":"https://github.com/tpvasconcelos/ridgeplot","commit_stats":{"total_commits":340,"total_committers":4,"mean_commits":85.0,"dds":"0.17352941176470593","last_synced_commit":"2d87e3ed45f99e14fa27b25b7afc60a802398997"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpvasconcelos%2Fridgeplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpvasconcelos%2Fridgeplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpvasconcelos%2Fridgeplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpvasconcelos%2Fridgeplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpvasconcelos","download_url":"https://codeload.github.com/tpvasconcelos/ridgeplot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208142,"owners_count":20901570,"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":["data-analysis","data-science","data-visualization","distplot","ggridges","graphing","joyplot","plot","plotly","plotting","python","ridgeline","visualization"],"created_at":"2024-11-05T20:06:06.648Z","updated_at":"2025-04-04T16:12:26.945Z","avatar_url":"https://github.com/tpvasconcelos.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"docs/_static/img/logo-wide.png#gh-light-mode-only\" alt=\"ridgeplot - beautiful ridgeline plots in Python\"\u003e\n    \u003cimg src=\"docs/_static/img/logo-wide-dark.png#gh-dark-mode-only\" alt=\"ridgeplot - beautiful ridgeline plots in Python\"\u003e\n\u003c/p\u003e\n\n\u003ch1 id=\"ridgeplot\" align=\"center\"\u003e\n    ridgeplot: beautiful ridgeline plots in Python\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003c!-- TODO: https://bestpractices.coreinfrastructure.org/en --\u003e\n  \u003c!-- TODO: https://www.gitpod.io/docs/getting-started --\u003e\n  \u003ca href=\"https://pypi.org/project/ridgeplot/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/ridgeplot\" alt=\"PyPI - Latest Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tpvasconcelos/ridgeplot/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/ridgeplot\" alt=\"PyPI - Python Versions\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/ridgeplot\"\u003e\u003cimg src=\"https://img.shields.io/pepy/dt/ridgeplot\" alt=\"Pepy Total Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/ridgeplot/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/status/ridgeplot.svg\" alt=\"PyPI - Package Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tpvasconcelos/ridgeplot/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/pypi/l/ridgeplot\" alt=\"PyPI - License\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/tpvasconcelos/ridgeplot/actions/workflows/ci.yml/\"\u003e\u003cimg src=\"https://github.com/tpvasconcelos/ridgeplot/actions/workflows/ci.yml/badge.svg\" alt=\"GitHub CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tpvasconcelos/ridgeplot/actions/workflows/codeql.yml/\"\u003e\u003cimg src=\"https://github.com/tpvasconcelos/ridgeplot/actions/workflows/codeql.yml/badge.svg\" alt=\"CodeQL\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://ridgeplot.readthedocs.io/en/latest/\"\u003e\u003cimg src=\"https://readthedocs.org/projects/ridgeplot/badge/?version=latest\u0026style=flat\" alt=\"Docs\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/tpvasconcelos/ridgeplot\"\u003e\u003cimg src=\"https://codecov.io/gh/tpvasconcelos/ridgeplot/branch/main/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.codefactor.io/repository/github/tpvasconcelos/ridgeplot\"\u003e\u003cimg src=\"https://www.codefactor.io/repository/github/tpvasconcelos/ridgeplot/badge\" alt=\"CodeFactor\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://app.codacy.com/gh/tpvasconcelos/ridgeplot/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade\"\u003e\u003cimg src=\"https://app.codacy.com/project/badge/Grade/e21652ac49874b6f94ed3c9b7ac77021\" alt=\"Codacy code quality Badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n-----------------\n\n`ridgeplot` is a Python package that provides a simple interface for plotting beautiful and interactive [ridgeline plots](https://ridgeplot.readthedocs.io/en/stable/getting_started/getting_started.html) within the extensive [Plotly](https://plotly.com/python/) ecosystem.\n\n## Installation\n\n`ridgeplot` can be installed and updated from [PyPi](https://pypi.org/project/ridgeplot/) using [pip](https://pip.pypa.io/en/stable/quickstart/):\n\n```shell\npip install -U ridgeplot\n```\n\nFor more information, see the [installation guide](https://ridgeplot.readthedocs.io/en/stable/getting_started/installation.html).\n\n## Getting started\n\nTake a look at the [getting started guide](https://ridgeplot.readthedocs.io/en/stable/getting_started/getting_started.html), which provides a quick introduction to the `ridgeplot` library.\n\nThe full official documentation can be found at: https://ridgeplot.readthedocs.io/en/stable/\n\n### Basic example\n\nFor those in a hurry, here's a very basic example on how to quickly get started with [ridgeplot()](https://ridgeplot.readthedocs.io/en/stable/api/public/ridgeplot.ridgeplot.html) function.\n\n```python\nimport numpy as np\nfrom ridgeplot import ridgeplot\n\nmy_samples = [np.random.normal(n / 1.2, size=600) for n in range(7, 0, -1)]\nfig = ridgeplot(samples=my_samples)\nfig.show()\n```\n\n![ridgeline plot example using the ridgeplot Python library](docs/_static/charts/basic.webp)\n\n### Flexible configuration\n\nIn this example, we will try to replicate the first ridgeline plot in this [_from Data to Viz_ post](https://www.data-to-viz.com/graph/ridgeline.html). The example in the post was created using the [_\"Perception of Probability Words\"_ dataset](https://ridgeplot.readthedocs.io/en/stable/api/public/ridgeplot.datasets.load_probly.html) and the popular [ggridges](https://wilkelab.org/ggridges/) R package. In the end, we will see how the `ridgeplot` Python library can be used to create a (nearly) identical plot, thanks to its extensive configuration options.\n\n```python\nimport numpy as np\nfrom ridgeplot import ridgeplot\nfrom ridgeplot.datasets import load_probly\n\n# Load the probly dataset\ndf = load_probly()\n\n# Let's grab the subset of columns used in the example\ncolumn_names = [\n    \"Almost Certainly\",\n    \"Very Good Chance\",\n    \"We Believe\",\n    \"Likely\",\n    \"About Even\",\n    \"Little Chance\",\n    \"Chances Are Slight\",\n    \"Almost No Chance\",\n]\ndf = df[column_names]\n\n# Not only does 'ridgeplot(...)' come configured with sensible defaults\n# but is also fully configurable to your own style and preference!\nfig = ridgeplot(\n    samples=df.to_numpy().T,\n    bandwidth=4,\n    kde_points=np.linspace(-12.5, 112.5, 500),\n    colorscale=\"viridis\",\n    colormode=\"row-index\",\n    opacity=0.6,\n    labels=column_names,\n    spacing=5 / 9,\n)\n\n# And you can still update and extend the final\n# Plotly Figure using standard Plotly methods\nfig.update_layout(\n    height=560,\n    width=800,\n    font_size=16,\n    plot_bgcolor=\"white\",\n    xaxis_tickvals=[-12.5, 0, 12.5, 25, 37.5, 50, 62.5, 75, 87.5, 100, 112.5],\n    xaxis_ticktext=[\"\", \"0\", \"\", \"25\", \"\", \"50\", \"\", \"75\", \"\", \"100\", \"\"],\n    xaxis_gridcolor=\"rgba(0, 0, 0, 0.1)\",\n    yaxis_gridcolor=\"rgba(0, 0, 0, 0.1)\",\n    yaxis_title=dict(text=\"Assigned Probability (%)\", font_size=13),\n    showlegend=False,\n)\n\n# Show us the work!\nfig.show()\n```\n\n![ridgeline plot of the probly dataset using the ridgeplot Python library](docs/_static/charts/probly.webp)\n\n### More examples\n\nFor more examples, take a look at the [getting started guide](https://ridgeplot.readthedocs.io/en/stable/getting_started/getting_started.html). For instance, this example demonstrates how you can also draw [multiple traces](https://ridgeplot.readthedocs.io/en/stable/getting_started/getting_started.html#more-traces) per row in your ridgeline plot:\n\n```python\nimport numpy as np\nfrom ridgeplot import ridgeplot\nfrom ridgeplot.datasets import load_lincoln_weather\n\n# Load test data\ndf = load_lincoln_weather()\n\n# Transform the data into a 3D (ragged) array format of\n# daily min and max temperature samples per month\nmonths = df.index.month_name().unique()\nsamples = [\n    [\n        df[df.index.month_name() == month][\"Min Temperature [F]\"],\n        df[df.index.month_name() == month][\"Max Temperature [F]\"],\n    ]\n    for month in months\n]\n\n# And finish by styling it up to your liking!\nfig = ridgeplot(\n    samples=samples,\n    labels=months,\n    colorscale=\"Inferno\",\n    bandwidth=4,\n    kde_points=np.linspace(-40, 110, 400),\n    spacing=0.3,\n)\nfig.update_layout(\n    title=\"Minimum and maximum daily temperatures in Lincoln, NE (2016)\",\n    height=600,\n    width=800,\n    font_size=14,\n    plot_bgcolor=\"rgb(245, 245, 245)\",\n    xaxis_gridcolor=\"white\",\n    yaxis_gridcolor=\"white\",\n    xaxis_gridwidth=2,\n    yaxis_title=\"Month\",\n    xaxis_title=\"Temperature [F]\",\n    showlegend=False,\n)\nfig.show()\n```\n\n![ridgeline plot of the Lincoln Weather dataset using the ridgeplot Python library](docs/_static/charts/lincoln_weather.webp)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpvasconcelos%2Fridgeplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpvasconcelos%2Fridgeplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpvasconcelos%2Fridgeplot/lists"}