File Exchange

image thumbnail

Stacked line plot

version (715 KB) by Christopher Hummersone
Stacked line plots from a matrix or vectors


Updated 05 May 2018

GitHub view license on GitHub

NOTE: this function is now available from the IoSR Matlab Toolbox as iosr.figures.multiwaveplot.
Multiwaveplot draws a series of stacked waves (one on top of the other) contained in the rows of an input 2-D matrix. Each wave has a designated row on the plot. Data may also be specified as vectors X, Y, and Z. The plot is similar to a cascade or waterfall plot.

Cite As

Christopher Hummersone (2020). Stacked line plot (, GitHub. Retrieved .

Comments and Ratings (1)

It does exactly what it says! Thank you for this very useful submission!


Migrated to GitHub.

Fixed how function handles y-scale-ends, and updated documentation.

Added option to reverse y-axis direction.

Reconfigured interface. Added horizon options and support for vector inputs.

Minor tweak to how y-axis min is calculated.

Corrected two bugs: one where scale would be recursively updated depending on magnitude order in wave, and the other where y axis min was erroneous if gain was set.

Added trap for cases where input contents are all zero (or, at least one row is).

Corrected ylim so that top row is not cropped when gain is applied.

Some bug fixes and efficiency savings. Updated documentation.

Minor updates to example and validation; new screenshot.

Tidied up, updated description

Ooops, forgot to check the MODE argument

Added optional plotting mode argument: 'fill' or 'plot'. 'plot' is useful for fine structure plotting, 'fill' is useful for correlograms. Tidied up input validation.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux