theme_tt: ttecon theme

View source: R/ttthemes.R

theme_ttR Documentation

ttecon theme

Description

Theme for ttecon figures.

Usage

theme_tt(
  style = "slide",
  palette = "green",
  font = NULL,
  title_font = NULL,
  subtitle_font = NULL,
  xaxis = TRUE,
  yaxis = FALSE,
  axis_text_color = "style",
  axis_title_color = "style",
  xgrid = FALSE,
  ygrid = TRUE,
  xgrid_minor = FALSE,
  ygrid_minor = FALSE,
  legend = FALSE,
  legend_title = FALSE,
  axis_title = TRUE,
  axis_title_just = "mm",
  xticks = FALSE,
  yticks = FALSE,
  title_size = NULL,
  subtitle_size = NULL,
  caption_size = NULL,
  legend_size = NULL,
  legend_title_size = NULL,
  strip_size = NULL,
  axis_title_size = NULL,
  axis_text_size = NULL,
  thick_line = NULL,
  thin_line = NULL,
  panel_spacing = NULL,
  legend_position = "bottom",
  font_scale = "normal"
)

Arguments

style

Change the theme style. Default to "slide" for default slide fonts and themed axis title and text. Change to "paper" for default paper fonts and black axis title and text.

palette

Change the palette. Default to "green" for green-shaded lines. Change to "brown" for brown-shaded lines.

font

Change the general font family. Default to NULL to use the defaults based on style.

title_font

Change the title font family. Default to NULL to use the defaults based on style.

subtitle_font

Change the subtitle font family. Default to NULL to use the defaults based on style.

xaxis

x-axis line if TRUE. Default to TRUE, The line is colored "green" for a green palette and is colored "brown" for a brown palette.

yaxis

y-axis line if TRUE. Default to FALSE. The line is colored "green" for a green palette and is colored "brown" for a brown palette.

axis_text_color

define the color style for axis text. If "style" then use a saturated palette color. Default to "style".

axis_title_color

define the color style for axis title. If "style" then use a saturated palette color. Default to "style".

xgrid

Turn on major x-grid-lines if TRUE. Default to FALSE. The line is colored "gradient green" for a green palette and is colored "gradient brown" for a brown palette.

ygrid

Turn on major y-grid-lines if TRUE. Default to TRUE. The line is colored "gradient green" for a green palette and is colored "gradient brown" for a brown palette.

xgrid_minor

Turn on minor x-grid-lines if TRUE. Default to FALSE. The line is colored "gradient green" for a green palette and is colored "gradient brown" for a brown palette.

ygrid_minor

Turn on minor y-grid-lines if TRUE. Default to FALSE. The line is colored "gradient green" for a green palette and is colored "gradient brown" for a brown palette.

legend

Allow legend if TRUE. Default to FALSE.

legend_title

Allow legend title if TRUE. Default to FALSE.

axis_title

Allow axis titles if TRUE. Default to TRUE.

axis_title_just

Axis title font justification, one of [blmcrt] Default to "mm".

xticks

Add x-ticks if TRUE. Default to FALSE.

yticks

Add y-ticks if TRUE. Default to FALSE.

title_size

Change title font size. Default to NULL to use the default based on font_scale.

subtitle_size

Change subtitle font size. Default to NULL to use the default based on font_scale.

caption_size

Change caption font size. Default to NULL to use the default based on font_scale.

legend_size

Change legend font size. Default to NULL to use the default based on font_scale.

legend_title_size

Change legend title font size. Default to NULL to use the default based on font_scale.

strip_size

Change strip font size. Default to NULL to use the default based on font_scale.

axis_title_size

Change axis title font size. Default to NULL to use the default based on font_scale.

axis_text_size

Change axis text font size. Default to NULL to use the default based on font_scale.

thick_line

Change default thickness of "thicker" lines. Default to NULL to use the default based on font_scale.

thin_line

Change default thickness of "thinner" lines. Default to NULL to use the default based on font_scale.

panel_spacing

Change default panel spacing in "lines" unit. Default to NULL to use the default of -0.25.

legend_position

Set legend position and alignment accordingly (active if legend set to TRUE). Default to "bottom".

font_scale

Make default font sizes larger and default lines thicker if "large" or default font sizes smaller and default lines thinner if "small". Default to "normal".

Value

ggplot theme

Examples

library(ggplot2)

ggplot(mtcars, aes(x = mpg * 0.43, y = wt * 0.4535924, color = factor(cyl))) +
  geom_point(size = 2) +
  labs(
    title = "Car weight vs efficiency",
    subtitle = "Using sensible metrics",
    x = "Efficiency (km/l)",
    y = "Weight (1000 kg)",
    color = "Cylinders",
    caption = "Brought to you by the letter 'T'"
  ) +
  theme_tt(style = "paper") +
  scale_color_tt()

ttecon/ttr documentation built on March 6, 2023, 7:36 a.m.