scale_fill_playax: scales for Playax plots in ggplot2

Description Usage Examples

View source: R/ggplot2-scales.R

Description

This package provides:

Usage

1
2
3
4
5
6
7

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(ggplot2)

data <- data.frame(
  day = rep(1:20, 3),
  metric = do.call(c, lapply(1:3, function(x) cumsum(rnorm(20, sd = 1e7)))),
  service = rep(c('facebook', 'instagram', 'spotify'), each = 20)
)

ggplot(data) +
  geom_line(aes(x = day, y = metric, col = service)) +
  theme_playax() +
  scale_color_playax() +
  scale_y_abbrv()

data <- rbind(
  data,
  data.frame(
    day = 1:20,
    metric = cumsum(rnorm(20, sd = 1e7)),
    service = rep('other', 20)
  )
)

ggplot(data) +
  geom_line(aes(x = day, y = metric, col = service)) +
  theme_playax() +
  scale_color_playax(palette = palette_playax_extended(extension = c('other'))) +
  scale_y_abbrv()

gmega/playaxr documentation built on Dec. 20, 2020, 6:22 a.m.