Waterfall chart is a 2D plot that is used to understand the effects of adding positive or negative values over time or over multiple steps or a variable. Waterfall chart is frequently used in financial analysis to understand the gain and loss contributions of multiple factors over a particular asset.
Contents
- Introduction
- Simple Waterfall Plot
- Varying parameters in Waterfall Plot
- Analyzing a waterfall plot
- Interpreting feature importance
Introduction
Waterfall chart is a 2-dimensional plot that is used to understanding the cumulative effects of sequentially added positive or negative values for a given variable.
This will help you in knowing about how an initial value is increased and decreased over time or over a series of intermediate steps.
The cumulative effects can be either time based or category based.
This type of plot is commonly used in financial analysis to understand how a particular value goes through gains and losses over time.
Notice that only some of the columns (generally initial and final column) are shown fully and the other columns in between are shown as floating columns( they only show the increase or decrease in the value).
We will look into how to draw a waterfall chart like the one shown above.
First, you need to install the waterfallcharts library to use the waterfall_chart.
# Install
!pip install waterfallcharts
Then I am going to import all the required libraries that I will be using in this article.
import pandas as pd
import numpy as np
import waterfall_chart
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams.update({'figure.figsize':(7.5,5), 'figure.dpi':100})
Now, let’s look at how to plot a simple waterfall chart in Python.
Simple Waterfall Plot
Use the plot() function in waterfall_chart library to generate a waterfall chart. Values of x and y-axis should be passed as parameters into the function. Let’s try to visualize a simple cash flow chart for whole year months.
# plotting a simple waterfall chart
import waterfall_chart
import matplotlib.pyplot as plt
a = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
b = [1000,-300,400,-100,100,-700,400,-300,500,-700,100,50]
waterfall_chart.plot(a, b);
You can see that it took the initial value and started adding and subtracting the values that I have passed and also calculated the final left out amount.
The increasing values are shown in green color and the decreasing values are shown in red color.
This plot is used extensively in the finance sector for checking their revenues.
Varying parameters in Waterfall plot
Set sorted_value=True inside the plot() function to sort the values based on the absolute value of every month.
# varying the sorted_value parameter
import waterfall_chart
import matplotlib.pyplot as plt
a = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
b = [1000,-300,400,-100,100,-700,400,-300,500,-700,100,50]
waterfall_chart.plot(a, b,sorted_value=True)
As you can see the values are sorted based on their absolute values in descending order.
Use the net_label="" command to change the final column name which is set to default as net.
rotation_value=90 can be used to rotate the x-axis names in vertical mode.
# varying the net_label parameter
import waterfall_chart
import matplotlib.pyplot as plt
a = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
b = [1000,-300,400,-100,100,-700,400,-300,500,-700,100,50]
waterfall_chart.plot(a, b,sorted_value=True,net_label='LeftOver',rotation_value=90)
There is also another command threshold which groups all contributions under a certain threshold to as a separate ‘other’ contribution.
If you set the value of the threshold to be 0.5, then it will take only the first half of the dataset and show it in the graph. The other part will be shown in the other column.
# using the threshold parameter
import waterfall_chart
import matplotlib.pyplot as plt
a = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
b = [1000,-300,400,-100,100,-700,400,-300,500,-700,100,50]
waterfall_chart.plot(a, b,sorted_value=True,net_label='LeftOver',rotation_value=90,threshold=0.5)
Analyzing a waterfall chart
A waterfall chart can be used for analytical purposes, especially for understanding the transition in the quantitative value of an entity that is subjected to increment or decrement.
Let’s look at a waterfall chart containing yearly data with revenue from each quarter and try to get some insights.

The first column initial contains the value at the start of the year. Then for each quarter, you can see whether the amount has increased or not. During the midway of the year, you can see that the value has decreased to 400.
Then during the next half, the value decreased in the 3rd quarter and increased in the 4th quarter leading to a total value of 425.
Waterfall charts represent increasing values in green color and decreasing values in red color.
Waterfall charts can also be used in various cases like inventory and performance analysis.
Waterfall Chart for Interpreting Feature Importance
I am going to be using the heart dataset from kaggle in which the main goal is to predict whether the person has got heart disease or not using the given features. I will be using RandomForestClassifier for modeling. Then the waterfall chart is used to visualize the importance of each variable.
Download the dataset from the given link :
https://www.kaggle.com/ronitf/heart-disease-uci/download
Now, let’s look at the code.
# importing the required files and libarries
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
df=pd.read_csv("heart.csv")
df.head()
# Build Random forest model
# 1. splitting the dataset into test and train
y=df['target']
df.drop('target',axis=1,inplace=True)
X_train,X_test,y_train,y_test=train_test_split(df,y)
# 2. creating the model
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
model = RandomForestClassifier(n_estimators = 150,
random_state = 101)
# 3. fitting the model
model.fit(X_train,y_train)
RandomForestClassifier(bootstrap=True, ccp_alpha=0.0, class_weight=None,
criterion='gini', max_depth=None, max_features='auto',
max_leaf_nodes=None, max_samples=None,
min_impurity_decrease=0.0, min_impurity_split=None,
min_samples_leaf=1, min_samples_split=2,
min_weight_fraction_leaf=0.0, n_estimators=150,
n_jobs=None, oob_score=False, random_state=101,
verbose=0, warm_start=False)
Let’s use treeinterpreter to interpret the importance of variables. So you need to install the library first.
!pip install treeinterpreter # for installing the first time
from treeinterpreter import treeinterpreter as ti
rownames = X_test.values[None,1]
prediction, bias, contributions = ti.predict(model, rownames)
contributions = [contributions[0][i][0] for i in range(len(contributions[0]))]
colnames = X_test.columns[0:].values
From the above output, you can use the column names and contributions to draw the waterfall_chart.
# waterfall chart
import waterfall_chart
my_plot=waterfall_chart.plot(colnames, contributions, rotation_value=90, threshold=0.3,formatting='{:,.3f}')
Recommended Posts
- Matplotlib Pyplot
- Top 50 Matplotlib Visualizations
- Matplotlib Tutorial – A complete guide to Python Plot
This article was contributed by Venmani.









I am continually grateful for your honest and transparent discussions about the realities of entrepreneurship, because your willingness to share your struggles with cash flow provides a much-needed sense of solidarity and practical financial advice.
На этом портале вы сможете найти много ценной материалов.
https://rosotels.ru/detail/2026-07-17-poteri-ot-zemletryaseniya-v-venesuele-pochti-dostigli-pyati-tysyach-chelovek.htm
I just wanted to drop a note to say how much your recent article on the power of intentional networking has impacted me, as it has shifted my focus to building genuine, mutually supportive professional relationships.
Your unique perspective on the intersection of technology and human connection is incredibly thought-provoking, and it has encouraged me to be much more intentional about how I use social media to enhance real relationships.
I truly admire your ability to consistently foster a positive digital community, because your thoughtful responses and compassionate posts create a truly supportive environment that I am incredibly grateful to be a part of.
I am so inspired by your recent post on bootstrapping a creative venture, because your realistic timeline and practical advice have given me the confidence to finally take the first steps toward my entrepreneurial dreams.
The sense of community and mutual support you have cultivated in this digital space is truly remarkable, and I want to personally thank you for consistently creating a safe, welcoming, and uplifting environment for all readers.
I cannot thank you enough for your recent article on the power of positive self-talk, because your practical exercises for reframing negative thoughts have helped me build a much kinder and more supportive internal dialogue.
БК предоставляют шанс делать ставки на различные турниры.
Крайне важно отдавать предпочтение надёжных букмекеров, а также тщательно изучать коэффициенты до оформлением пари.
Беттинг могут превратиться увлекательным досугом, однако необходимо соблюдать баланс осознанного подхода и ограничивать расходы.
https://motorhead.sneakero.ru/y3DXyb85XciD/
Онлайн-слоты — являются самые известные игры в онлайн-казино.
https://c.balenciager.ru/XSXhMeSu31l1/
Сникеры D&G — это идеальный симбиоз изысканной элегантности и актуальных веяний.
Ключевой чертой подобных пар считается запоминающийся дизайн с использованием качественных тканей и культовой отделки.
Эти кроссовки отлично смотрятся для повседневной эксплуатации, добавляя в лук долю роскоши.
https://sorrybabushka.ru/interesting/522-samye-vygodnye-mesyatsy-dlya-otpuska-kogda-vyplaty-dostigayut-pika-do-2026-goda.html
Модели бренда — представляют собой удачный симбиоз изысканной классики и современных направлений.
Главной деталью подобных моделей является запоминающийся внешний вид с использованием премиальных сырья и узнаваемой детализации.
Они великолепно сочетаются для повседневной эксплуатации, привнося в образ долю шика.
https://liveforsport.ru/full-text/1635-trendovye-stili-krossovok-dolce-andamp-gabbana-v-2024-godu-chto-aktualno-na-ulitsakh.html
Mindful gaming is a collection of practices that ensure betting remains a recreational activity instead of a means of financial strain.
Key aspects include setting individual boundaries on time and wagers, as well as recognising the signs of problematic behaviour.
In essence, this approach encourages conscious decisions and helps users to maintain balance over their playing activities.
https://eurasia-log.ru/blog/2026-06-20-polsha-otnyala-u-zelenskogo-orden-belyy-orel-novyy-shag-v-otnosheniyakh/
Responsible gambling is a set of principles that guarantee gambling stays a recreational activity instead of a means of financial strain.
Key aspects include establishing individual limits on duration and money spent, as well as recognising the indicators of harmful behaviour.
In essence, this approach promotes conscious choices and helps users to maintain control over their playing activities.
https://1-mk.ru/detail/434-semeynye-khroniki-goryachie-spory-vokrug-shepeleva-friske-i-volochkovoy/
Responsible gambling is a set of practices that ensure gambling stays a recreational activity instead of a means of financial strain.
Key aspects include setting individual boundaries on time and wagers, as well as recognising the signs of harmful behaviour.
Ultimately, responsible gambling promotes informed choices and supports users to keep control over their playing habits.
https://ipcfms.ru/read/375-responsible-gambling-at-rich-casino-tools-and-tips.html
Hi there just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Safari. I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I figured I’d post to let you know. The style and design look great though! Hope you get the problem fixed soon. Thanks
I got what you intend, thankyou for putting up.Woh I am delighted to find this website through google.
Осознанный гемблинг — это совокупность правил, направленных на защиту эмоционального и финансового равновесия участника.
Ключевая идея заключается в том, что игра должна восприниматься исключительно как досуг, а не как метод заработка.
Пользователю следует предварительно определять ограничения по длительности и деньгам и строго их придерживаться.
https://pilot-club.ru/info/2026-06-29-kak-vybrat-onlayn-kazino-rukovodstvo-dlya-novichkov/
Необходимо научиться распознавать первые симптомы проблемного поведения, такие как желание отыграться и игнорирование обязанностями.
Операторы обязаны предлагать функции ограничения: тайм-ауты, ограничения пополнений и блокировку аккаунта.
Следование этих правил даёт возможность удержать азарт в комфортных рамках, не нанося ущерба своей психике и близким.
Hi, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can recommend? I get so much lately it’s driving me mad so any help is very much appreciated.
But a smiling visitor here to share the love (:, btw outstanding design. “Individuals may form communities, but it is institutions alone that can create a nation.” by Benjamin Disraeli.
Hello. splendid job. I did not anticipate this. This is a remarkable story. Thanks!
This really answered my drawback, thank you!