Wwaterfall charts are two dimensional plots that show the cumulative
effects of sequential events. These plots are also known as flying
bricks charts or Mario charts; they look like bar charts where many of
the bars, rather than sitting nicely on the x axis, are flying in
midair.
ggalluvial: Alluvial Plots in ‘ggplot2’
- Alluvial plots use variable-width ribbons and stacked bar plots to
represent multi-dimensional or repeated-measures data with categorical
or ordinal variables; see Riehmann, Hanfler, and Froehlich (2005) doi:10.1109/INFVIS.2005.1532152 and Rosvall and
Bergstrom (2010) doi:10.1371/journal.pone.0008694.
- Alluvial plots are statistical graphics in the sense of Wilkinson
(2006) doi:10.1007/0-387-28695-0; they share elements with
Sankey diagrams and parallel sets plots but are uniquely determined from
the data and a small set of parameters.
- This package extends Wickham’s (2010) doi:10.1198/jcgs.2009.07098 layered grammar of graphics
to generate alluvial plots from tidy data.
df
## x y
## 1 A 2000
## 2 B 4000
## 3 C 2000
## 4 D -1500
## 5 E -1000
## 6 F -2500
Waterfall Plots
waterfall(df)

waterfall(values = value, labels = group)

waterfall(df, calc_total = TRUE)

waterfall(df) +theme_bw() + ggtitle("My Waterfall Plot")

waterfall(df,
fill_by_sign = FALSE,
fill_colours = 2:7)
