theme_tq: tidyquant themes for ggplot2.

Description Usage Arguments See Also Examples

Description

From tidyquant The 'theme_tq()' function creates a custom theme using tidyquant colors.

Usage

1
2
3
4
5
theme_tq(base_size = 11, base_family = "")

theme_tq_dark(base_size = 11, base_family = "")

theme_tq_green(base_size = 11, base_family = "")

Arguments

base_size

base font size

base_family

base font family

See Also

[scale_manual()]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Load libraries
library(tidyquant)

# Get stock prices
AAPL <- tq_get("AAPL")

# Plot using ggplot with theme_tq
AAPL %>% ggplot(aes(x = date, y = close)) +
       geom_line() +
       geom_bbands(aes(high = high, low = low, close = close),
                   ma_fun = EMA,
                   wilder = TRUE,
                   ratio = NULL,
                   n = 50) +
       coord_x_date(xlim = c(today() - years(1), today()),
                    ylim = c(80, 130)) +
       labs(title = "Apple BBands",
            x = "Date",
            y = "Price") +
       theme_tq()

mikebesso/two.laws.quant.charts documentation built on May 18, 2019, 9:14 p.m.