Skip to contents

Drop-in replacements for ggplot2::theme_bw() and friends, carrying the Cardiovascular Outcomes, Registries and Research (CORR) house style for four publication contexts:

Usage

theme_hv_manuscript(
  base_size = 12,
  base_family = "",
  header_family = NULL,
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  ink = "black",
  paper = "white",
  accent = "#3366FF",
  ...
)

theme_hv_poster(
  base_size = 16,
  base_family = "",
  header_family = NULL,
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  ink = "black",
  paper = "white",
  accent = "#3366FF",
  ...
)

theme_hv_ppt_dark(
  base_size = 32,
  base_family = "Arial",
  header_family = NULL,
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  ink = "white",
  paper = "transparent",
  accent = "#3366FF",
  ...
)

theme_hv_ppt_light(
  base_size = 32,
  base_family = "Arial",
  header_family = NULL,
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  ink = "black",
  paper = "transparent",
  accent = "#3366FF",
  ...
)

hv_theme_manuscript(...)

theme_manuscript(...)

theme_man(...)

hv_theme_poster(...)

theme_poster(...)

hv_theme_dark_ppt(...)

theme_dark_ppt(...)

hv_theme_ppt(...)

theme_ppt(...)

hv_theme_light_ppt(...)

theme_light_ppt(...)

Arguments

base_size

Base font size in points.

base_family

Base font family. Default "" (device default).

header_family

Font family for headers, or NULL to inherit base_family. Default NULL.

base_line_size

Line size used for axis lines and borders. Default base_size / 22.

base_rect_size

Rectangle border size. Default base_size / 22.

ink

Foreground (text and line) color.

paper

Background color.

accent

Accent color used by some theme_gray() elements. Default "#3366FF".

...

Additional named theme elements forwarded to a final ggplot2::theme() call. Use this to override any theme element from the call site, e.g. legend.position = "right".

Value

A ggplot2::theme() object.

Details

  • theme_hv_manuscript(): clean white background for journal figures

  • theme_hv_poster(): medium-font theme with visible axis lines for posters

  • theme_hv_ppt_dark(): dark panel background, white text, large font

  • theme_hv_ppt_light(): light/transparent panel background, black text

Each theme follows the theme_bw() contract: pass base_size / base_family to control global typography, then chain a + theme(...) call to override anything else. Any extra named argument goes straight into a final ggplot2::theme() call; tweak elements at the call site without a separate + chain:

theme_hv_manuscript(legend.position = "right")
theme_hv_ppt_dark(plot.title = element_text(hjust = 0.5))

Your elements override the hvtiPlotR defaults.

theme_hv_ppt_dark() is the default PPT theme: a black panel with white text suited to dark slide backgrounds. Use theme_hv_ppt_light() when the slide template is light. Both PPT themes hide the legend by default; override with legend.position = "right" (or chain + theme(...)).

Margins on axis text/title are scaled from base_size via the standard half_line = base_size / 2 convention; a deck at base_size = 28 and one at base_size = 36 both feel proportionate without you touching the margins.

base_family defaults to "Arial", the CORR slide standard. Arial isn't one of R's built-in PostScript fonts, so a device that resolves fonts through that closed metrics table (postscript()/pdf(), e.g. R CMD check or headless Linux rendering) cannot draw it directly. When that happens, the plot falls back to "Helvetica" (metrically compatible) automatically at draw time, with a one-time session message explaining why; devices that resolve fonts via the OS (quartz, cairo, RStudio's graphics device) are unaffected and keep using real Arial. No global font registry is modified. See .hv_family_resolves() in ppt-font-fallback.R for the mechanism.

See also

save_ppt() to export a themed plot to an editable PowerPoint slide; make_footnote() to annotate a draft figure before publication.