Vertical ribbons and area plots
geom_ribbonh(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
GeomRibbonh
geom_areah(
mapping = NULL,
data = NULL,
stat = "identity",
position = "stackv",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
GeomAreah
An object of class GeomRibbonh
(inherits from Geom
, ggproto
, gg
) of length 6.
An object of class GeomAreah
(inherits from GeomRibbonh
, Geom
, ggproto
, gg
) of length 4.
See geom_ribbon.
library(ggplot2)
# Generate data
huron <- data.frame(year = 1875:1972, level = as.vector(LakeHuron))
h <- ggplot(huron, aes(y = year))
h + geom_ribbonh(aes(xmin=0, xmax=level))
h + geom_areah(aes(x = level))
# Add aesthetic mappings
h +
geom_ribbonh(aes(xmin = level - 1, xmax = level + 1), fill = "grey70") +
geom_lineh(aes(x = level))