Skip to contents

A minimal horizontal-bar theme: no lane gridlines, light vertical gridlines, no y-axis title, and legends along the bottom. Legend titles are suppressed since swimlane legends (cohort fills, event symbols) are typically self-explanatory; restore them via ... if needed.

Usage

theme_swimlane(base_size = 11, base_family = "", extra_margin_r = 10, ...)

Arguments

base_size

Base font size in pts, passed to ggplot2::theme_minimal().

base_family

Base font family, passed to ggplot2::theme_minimal(). The default "" uses the graphics device's default font, which works on every system; pass an installed font's name to use a house font.

extra_margin_r

Extra right margin in pts, to make room for annotations that extend past the last bar (e.g. geom_swimlane_label()).

...

Further arguments passed to ggplot2::theme(), overriding the defaults set here. For an inside legend, use legend.position = "inside", legend.position.inside = c(x, y).

Value

A ggplot2 theme object.

Examples

library(ggplot2)

ggplot(patient_disposition) +
  geom_swimlane(subject, weeks_on_study, cohort) +
  labs(x = "Weeks on study") +
  theme_swimlane()