Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Waterfall Plots

Waterfall plots (also known as ridge or joy plots) are essential in Magnetic Resonance Spectroscopy (MRS) for visualizing kinetic, dynamic, or relaxation series. By vertically stacking and horizontally offsetting 1D spectra, they allow the human eye to easily track peak growth, decay, and frequency shifts over an independent variable like time .

In xmris, this visualization is built entirely around our WaterfallConfig object, giving you publication-ready results without cluttering your function calls.

1. Data Requirements

Before plotting, your xarray.DataArray must meet the following criteria:

2. Generating Synthetic Data

We will generate a realistic kinetic time-course of a hyperpolarized 13C experiment where Pyruvate decays and Lactate grows over 60 seconds.

Time series data generation

We will use the xmris.fitting.simulation module:

3. Basic Usage

Because we utilize an intelligent xarray accessor, the simplest plotting call requires zero arguments. The accessor dynamically reads the dataset’s units and dimensions to build the axes automatically.

<Figure size 800x600 with 1 Axes>

4. Advanced Configuration

To customize the plot, do not pass endless keyword arguments. Instead, instantiate a WaterfallConfig. Outputting this object in a notebook renders a table of all available styling options.

Loading...

You can update these parameters using standard attribute assignment. Let’s create a dynamic, pseudo-3D angled sheer with heavy overlap.

<Figure size 800x600 with 1 Axes>

5. Subplot Integration (Wireframe Mode)

Professional library functions should never hijack your global plotting environment. Because plot.waterfall() returns a standard matplotlib.Axes object and accepts an ax keyword argument, you can easily embed these visualizations into multi-panel figures.

Here, we also demonstrate the Wireframe Mode by setting cmap=None, which disables the filled polygons for a clean, minimalist look.

<Figure size 600x600 with 2 Axes>