theme_cowplot: Create the default cowplot theme

Description Usage Arguments Details Value Examples

View source: R/themes.R

Description

The default cowplot theme, with a simple half-open frame and no grid. This theme used to be set by default after loading the cowplot package, but this is no longer the case.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
theme_cowplot(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14
)

theme_half_open(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14
)

Arguments

font_size

Overall font size.

font_family

Font family for plot title, axis titles and labels, legend texts, etc.

line_size

Line size for axis lines.

rel_small

Relative size of small text (e.g., axis tick labels)

rel_tiny

Relative size of tiny text (e.g., caption)

rel_large

Relative size of large text (e.g., title)

Details

Both theme_cowplot() and theme_half_open() provide exactly the same styling.

Value

The theme.

Examples

1
2
3
4
5
library(ggplot2)

ggplot(mtcars, aes(disp, mpg)) +
  geom_point() +
  theme_cowplot(font_size = 12)

Example output

Loading required package: ggplot2

Attaching package: 'cowplot'

The following object is masked from 'package:ggplot2':

    ggsave

cowplot documentation built on Dec. 30, 2020, 5:07 p.m.