line_theme: Line plot themes

Description Usage Arguments Author(s) See Also Examples

Description

Line plot themes

Usage

1
line_theme(base_size = 10, box = FALSE, grid = if (box) "" else "y")

Arguments

base_size

Sent to theme_bw

box

Whether to draw box or not.

grid

Which grid lines to draw (xy-string).

Author(s)

Christofer Bäcklin

See Also

tmt_theme.

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
library(ggplot2)
library(grid)
library(gridExtra)

set.seed(123)
plot_data <- data.frame(
  Time = as.Date('2016-01-01') + 0:100,
  Estimate = cumsum(rnorm(101)),
  s = cumsum(rgamma(101, .1, 10))
)

p_default <- ggplot(plot_data, aes(x = Time, y = Estimate)) +
  geom_line() +
  geom_ribbon(aes(ymin = Estimate - s, ymax = Estimate + s), fill = "#00000022") +
  scale_x_date(breaks = range(plot_data$Time)) +
  scale_y_continuous(
    breaks = c(0, range(plot_data$Estimate)),
    labels = function(x) sprintf("%.2f USD", x)
  )

grid.arrange(
  p_default,
  p_default + line_theme(),
  p_default + line_theme(box = TRUE),
  nrow = 2, ncol = 2
)

backlin/treesmapstheorems documentation built on May 11, 2019, 5:23 p.m.