sg_axis_y: Modify streamgraph y axis formatting

Description Usage Arguments Value Examples

View source: R/sg_axis_y.r

Description

Change the tick count & format

Usage

1
sg_axis_y(sg, tick_count = 5, tick_format = ",g")

Arguments

sg

streamgraph object

tick_count

number of y axis ticks, not tick interval (defaults to 5); make this 0 if you want to hide the y axis labels

tick_format

d3 tick format string

Value

streamgraph object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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_axis_x(20, "year", "%Y") %>%
  sg_axis_y(0)

## End(Not run)#' @export

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