theme_tam: Tribune de Genève / Tamedia Romandie chart theme

View source: R/tamTheme.R

theme_tamR Documentation

Tribune de Genève / Tamedia Romandie chart theme

Description

ggplot theme copied from https://github.com/hrbrmstr/hrbrthemes

Usage

theme_tam(
  ticks = FALSE,
  grid = "XY",
  axis = T,
  yAxisNoTitle = F,
  base_family = "IBM Plex Sans",
  base_size = 15,
  plot_title_family = base_family,
  plot_title_size = 20,
  plot_title_face = "bold",
  plot_title_margin = 12,
  subtitle_family = "IBM Plex Sans Light",
  subtitle_size = 15,
  subtitle_face = "plain",
  subtitle_margin = 8,
  strip_text_family = base_family,
  strip_text_size = 16,
  strip_text_face = "plain",
  caption_family = "IBM Plex Sans Light",
  caption_size = 11,
  caption_face = "plain",
  caption_margin = 12,
  axis_text_size = base_size - (base_size/10),
  axis_title_family = base_family,
  axis_title_size = 15,
  axis_title_face = "bold",
  axis_title_just = "rt",
  plot_margin = margin(9, 12, 7, 3),
  grid_col = "#d6d7dd",
  axis_col = "#333333",
  axis.text.colour = "#333333",
  axis.title.colour = "#202346",
  axis.ticks.colour = "#393d60"
)

theme_tamap(...)

Arguments

ticks

logical show axis ticks?

grid

panel grid ('TRUE', 'FALSE', or a combination of 'X', 'x', 'Y', 'y')

axis

add x or y axes? 'TRUE', 'FALSE', "'xy'"

yAxisNoTitle

a logical, should the y title, y-axis and y-ticks be removed? See this example https://rud.is/b/2016/03/16/supreme-annotations/

base_family, base_size

base font family and size

plot_title_family, plot_title_face, plot_title_size, plot_title_margin

plot title family, face, size and margi

subtitle_family, subtitle_face, subtitle_size

plot subtitle family, face and size

subtitle_margin

plot subtitle margin bottom (single numeric value)

strip_text_family, strip_text_face, strip_text_size

facet label font family, face and size

caption_family, caption_face, caption_size, caption_margin

plot caption family, face, size and margin

axis_text_size

font size of axis text

axis_title_family, axis_title_face, axis_title_size

axis title font family, face and size

axis_title_just

axis title font justification, one of '[blmcrt]'

plot_margin

plot margin (specify with [ggplot2::margin()])

grid_col, axis_col

grid & axis colors; default to '#666666' and '#333333'

axis.title.colour, axis.ticks.colour, axis.text.colour

a string, a colour

...

Arguments passed on to theme_tam

base_family,base_size

base font family and size

plot_title_family,plot_title_face,plot_title_size,plot_title_margin

plot title family, face, size and margi

subtitle_family,subtitle_face,subtitle_size

plot subtitle family, face and size

strip_text_family,strip_text_face,strip_text_size

facet label font family, face and size

caption_family,caption_face,caption_size,caption_margin

plot caption family, face, size and margin

axis_title_family,axis_title_face,axis_title_size

axis title font family, face and size

grid_col,axis_col

grid & axis colors; default to '#666666' and '#333333'

axis.title.colour,axis.ticks.colour,axis.text.colour

a string, a colour

Examples

## Not run: 
require(ggplot2)
require(dqnTheme)

qplot(1:10, 1:10, size = 10:1) + 
  xlab("axis x label") + 
  ylab ("y axis label") + 
  theme_tam() +
  labs(title = "A catchy long <span style = 'color:red;'>title</span>, that should be wrapped which is pretty awesome", 
    subtitle = "A descriptive subtitle, that is also wrapped, pure awesomeness too.",
    caption = "caption: Lorem ipsum dolor sit amet, consectetur adipiscing elit. A long caption that wraps too yo!")

# based on https://rud.is/b/2016/03/16/supreme-annotations/
qplot(1:10, 1:10, size = 10:1) + 
  xlab("axis x label") + 
  ylab ("y axis label") + 
  theme_tam(yAxisNoTitle = TRUE, grid = 'x') +
  labs(
    title = "A catchy title", 
    subtitle = "A descriptive subtitle", caption = "source: ofs | Tamedia") +
  annotate(geom = "label", x = 0.2, y = 10, 
    label = "super unité", hjust = 0, vjust = 0.5, 
   label.padding = unit(0.15, "lines"),
   label.size = 0)

qplot(mtcars$mpg) + 
  labs(title = "A catchy title", 
  subtitle = "a descriptive subtitle") +
theme_tam()
# seminal scatterplot
gp <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point() +
  labs(x="Fuel effiiency (mpg)", y="Weight (tons)",
       title="Seminal ggplot2 scatterplot example",
       subtitle="A plot that is only useful for demonstration purposes",
       caption="Brought to you by the letter 'g'")
gp + theme_tam()
gp + theme_tam(ticks = T)
gp + theme_tam(axis = F)
gp + theme_tam(grid = '')
gp + theme_tam(axis_col = "#d6d7dd")
gp + theme_tam( axis.text.colour = "#d6d7dd", axis_col = "#d6d7dd")

## End(Not run)
require(ggplot2)
require(dqnTheme)
qplot(1:10, 1:10, size = 10:1) + theme_tamap()

d-qn/tamTheme documentation built on Feb. 8, 2023, 10:46 a.m.