stat_waterfall: Plot a time series as a waterfall plot

Description Usage Arguments Aesthetics Cosmetic Tips Also See Examples

View source: R/stat_waterfall.R

Description

Plot a time series as a waterfall plot

Usage

1
2
stat_waterfall(mapping = NULL, data = NULL, show.legend = NA,
  inherit.aes = TRUE, na.rm = T, bandwidth = NULL, ...)

Arguments

mapping

mapping

data

data

show.legend

legend

inherit.aes

logical

na.rm

logical

bandwidth

bandwidth

...

more functions

A waterfall plot highlights the change in the time series rather than the value of the time series itself.

Aesthetics

stat_waterfall needs x, y

Cosmetic Tips

The minimalist look can be achieved by appending the following chunk of code to the output object: + xlab(NULL) + ylab(NULL) + theme( axis.text = element_blank(), axis.ticks = element_blank(), legend.position = 'none', strip.background = element_blank(), plot.background = element_blank(), panel.background = element_blank(), panel.border = element_blank(), panel.grid = element_blank(), panel.border = element_blank() )

Also See

ggplot_waterfall, a flexible but less polished alternative.

Examples

1
2
3
4
5
6
{
library(ggplot2)
set.seed(1)
dfData = data.frame(x = 1:20, y = cumsum(rnorm(20)))
ggplot(dfData, aes(x =x, y = y) )+
   stat_waterfall()}

Example output

Loading required package: ggplot2

ggTimeSeries documentation built on Jan. 23, 2022, 5:07 p.m.