Shaded time series

Plot time series one above the other with coloured strips highlighting interesting features.
Updated 8 Mar 2011

View License

Use this function to plot several time series aligned beneath each other with shaded blocks highlighting important sections.

Cite As

Carl Fischer (2024). Shaded time series (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Time Series in Help Center and MATLAB Answers

Inspired by: ShadePlotForEmphasis

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Slight improvement to parameter consistency checks.

Accept different indicators to shade each subplot differently.
If the user specifies a single column of data then use the current plot instead of creating a new one to allow the user more control (eg. custom subplots).

Detect inconsistent data lengths.

Fixed bug that occurred when X was a row vector.

Allow data in rows or columns. Extra sanity checks on data lengths.