fig_ribbon: Ribbon

Description Usage Arguments Examples

Description

Add a ribbon based on x, ymin, ymax, and optionally group aspects.

Usage

1
fig_ribbon(g2, ..., data = NULL, inherit_asp = TRUE, name = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

...

Any option, aesthetic (asp), or animation (Animation).

data

A data.frame containing data to chart or a list.

inherit_asp

Whether to inherit aspects from g2r.

name

Name of figure, useful to apply functions to specific figures.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
df <- dplyr::tibble(
  x = 1:100,
  y = runif(100, 7, 18),
  y1 = runif(100, 5, 10),
  y2 = runif(100, 12, 20)
) %>% 
  dplyr::mutate(
    y = runif(dplyr::n(), y1 + 1, y2 - 1)
  )

g2(df, asp(x, y, ymin = y1, ymax = y2)) %>% 
  fig_line() %>% 
  fig_ribbon(axes = FALSE)

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.