File Exchange

image thumbnail

Waterfall Chart

version 1.0.0.1 (1.8 KB) by Patrick Kalita
This function shows incremental changes in a vector graphically in as a waterfall chart.

6 Downloads

Updated 01 Sep 2016

View License

A waterfall chart shows the incremental changes between successive elements of a row vector. More information on waterfall charts can be found at:
http://en.wikipedia.org/wiki/Waterfall_chart

This function takes a single row vector as an input. The colors of the bars are determined by the axes' colormap. The first row of the colormap is used for decreasing intervals - red by default. The second row of the colormap is used for increasing intervals - green by default. The third row of the colormap is used for the terminal values - blue by default.

The function returns a structure containing the handles to the patch object which (the bars) and the line objects (the connections between the bars).

An optional input parameter 'width' controls the width of the bars.

Examples:

x = [1 2 4 3 6 5 3];
waterfallchart(x);
waterfallchart(x, 'width', 0.4);

Comments and Ratings (2)

H. DEMAIE

Trevor

Does what it says, but options for customization are very limited. How would I change this to be a horizontal waterfall chart? Also, how can I change the colormap from the default? Help appreciated.

Updates

1.0.0.1

Updated license

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