The geom_stepribbon is an extension of the geom_ribbon, and is optimized for Kaplan-Meier plots with pointwise confidence intervals or a confidence band.

Usage

geom_stepribbon(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, kmplot = FALSE, ...)

The additional argument

Other arguments are the same as the geom_ribbon.

Example

require("ggplot2")
## Loading required package: ggplot2
huron <- data.frame(year = 1875:1972, level = as.vector(LakeHuron))
h <- ggplot(huron, aes(year))
h + RcmdrPlugin.KMggplot2::geom_stepribbon(
      aes(ymin = level - 1, ymax = level + 1),
      fill = "grey70"
    ) +
    geom_step(aes(y = level))
## Note: the specification for S3 class "family" in package 'MatrixModels' seems equivalent to one from package 'lme4': not turning on duplicate class definitions for this class.

h + geom_ribbon(
      aes(ymin = level - 1, ymax = level + 1),
      fill = "grey70"
    ) +
    geom_line(aes(y = level))