sg_colors: Modify streamgraph colors

Description Usage Arguments Value Examples

View source: R/color.r

Description

Change the ColorBrewer palette being used

Usage

1
2
sg_colors(sg, palette = NULL, axis_color = "black",
  tooltip_color = "black", label_color = "black")

Arguments

sg

streamgraph object

palette

UNUSED; being removed in next release; use sg_fill_* instead

axis_color

color of the axis text (defaults to "black")

tooltip_color

color of the tooltip text (defaults to "black")

label_color

color of the label text for the legend select menu (defaults to "black")

Value

streamgraph object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
library(dplyr)
library(streamgraph)
ggplot2movies::movies %>%
select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>%
  tidyr::gather(genre, value, -year) %>%
  group_by(year, genre) %>%
  tally(wt=value) %>%
  ungroup %>%
  mutate(year=as.Date(sprintf("%d-01-01", year))) -> dat

streamgraph(dat, "genre", "n", "year") %>%
  sg_colors("PuOr")

## End(Not run)

hrbrmstr/streamgraph documentation built on May 17, 2019, 5:14 p.m.