Skip to main content

ridgeplot - beautiful ridgeline plots in Python ridgeplot - beautiful ridgeline plots in Python

ridgeplot: beautiful ridgeline plots in Python

PyPI - Latest Release PyPI - Python Versions Pepy Total Downloads PyPI - Package Status PyPI - License
GitHub CI CodeQL Docs codecov CodeFactor Codacy code quality Badge


ridgeplot is a Python package that provides a simple interface for plotting beautiful and interactive ridgeline plots within the extensive Plotly ecosystem.

Installation

ridgeplot can be installed and updated from PyPi using pip:

pip install -U ridgeplot

For more information, see the installation guide.

Getting started

Take a look at the getting started guide, which provides a quick introduction to the ridgeplot library.

The full official documentation can be found at: https://ridgeplot.readthedocs.io/en/stable/

Basic example

For those in a hurry, here's a very basic example on how to quickly get started with the ridgeplot() function.

import numpy as np
from ridgeplot import ridgeplot

my_samples = [np.random.normal(n, size=900) for n in range(6, 0, -2)]
fig = ridgeplot(samples=my_samples)
fig.show()

ridgeline plot example using the ridgeplot Python library

Flexible configuration

In this example, we will try to replicate the first ridgeline plot in this from Data to Viz post. The example in the post was created using the "Perception of Probability Words" dataset and the popular 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.

import numpy as np
from ridgeplot import ridgeplot
from ridgeplot.datasets import load_probly

# Load the probly dataset
df = load_probly()

# Let's grab the subset of columns used in the example
column_names = [
    "Almost Certainly",
    "Very Good Chance",
    "We Believe",
    "Likely",
    "About Even",
    "Little Chance",
    "Chances Are Slight",
    "Almost No Chance",
]
df = df[column_names]

# Not only does 'ridgeplot(...)' come configured with sensible defaults
# but is also fully configurable to your own style and preference!
fig = ridgeplot(
    samples=df.to_numpy().T,
    bandwidth=4,
    kde_points=np.linspace(-12.5, 112.5, 500),
    colorscale="viridis",
    colormode="row-index",
    opacity=0.6,
    labels=column_names,
    spacing=5 / 9,
)

# And you can still update and extend the final
# Plotly Figure using standard Plotly methods
fig.update_layout(
    height=560,
    width=800,
    font_size=16,
    plot_bgcolor="white",
    xaxis_tickvals=[-12.5, 0, 12.5, 25, 37.5, 50, 62.5, 75, 87.5, 100, 112.5],
    xaxis_ticktext=["", "0", "", "25", "", "50", "", "75", "", "100", ""],
    xaxis_gridcolor="rgba(0, 0, 0, 0.1)",
    yaxis_gridcolor="rgba(0, 0, 0, 0.1)",
    yaxis_title=dict(text="Assigned Probability (%)", font_size=13),
    showlegend=False,
)

# Show us the work!
fig.show()

ridgeline plot of the probly dataset using the ridgeplot Python library

More examples

For more examples, take a look at the getting started guide. For instance, this example demonstrates how you can also draw multiple traces per row in your ridgeline plot:

import numpy as np
from ridgeplot import ridgeplot
from ridgeplot.datasets import load_lincoln_weather

# Load test data
df = load_lincoln_weather()

# Transform the data into a 3D (ragged) array format of
# daily min and max temperature samples per month
months = df.index.month_name().unique()
samples = [
    [
        df[df.index.month_name() == month]["Min Temperature [F]"],
        df[df.index.month_name() == month]["Max Temperature [F]"],
    ]
    for month in months
]

# And finish by styling it up to your liking!
fig = ridgeplot(
    samples=samples,
    row_labels=months,
    colorscale="Inferno",
    bandwidth=4,
    kde_points=np.linspace(-40, 110, 400),
    spacing=0.3,
)
fig.update_layout(
    title="Minimum and maximum daily temperatures in Lincoln, NE (2016)",
    height=600,
    width=800,
    font_size=14,
    plot_bgcolor="rgb(245, 245, 245)",
    xaxis_gridcolor="white",
    yaxis_gridcolor="white",
    xaxis_gridwidth=2,
    yaxis_title="Month",
    xaxis_title="Temperature [F]",
    showlegend=False,
)
fig.show()

ridgeline plot of the Lincoln Weather dataset using the ridgeplot Python library

Metadata

Release files for ridgeplot 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ridgeplot 0.6.0
File Size Uploaded
ridgeplot-0.6.0.tar.gz 2.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ridgeplot 0.6.0
File Interpreter ABI Platform
ridgeplot-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.5 MB

Release files / ridgeplot-0.6.0.tar.gz

Download URL ridgeplot-0.6.0.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
d810606a12c279fa8d25f7cd2bb6772a73dec68e611044d68b18622c26440b2b
BLAKE2b-256 checksum
How to use checksums
3ec85cb2f8ee4d6e1f922dcb4ea233298b2bbe1fd83432dd152cc6e2d292e804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

Release files / ridgeplot-0.6.0-py3-none-any.whl

Download URL ridgeplot-0.6.0-py3-none-any.whl
Size 57.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eddcc0a4b423767f3285e2ee1d64b584b6ec1fb2e7616aaa5bc234c96d76cdba
BLAKE2b-256 checksum
How to use checksums
318607ee535e3b6e2cbb1d212d36a49ed9b25bf50ce73231494c064bf497a987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.30

2 release files

0.1.29

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.16

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page