The original ggplot2 theme for the book. It borrows from
theme_minimal() and theme_void(), then adjusts the panels, margins, and
legends and sets the text in the Ubuntu font.
Usage
theme_fmggp2(
base_size = 15,
base_family = "Ubuntu",
base_line_size = base_size/22,
base_rect_size = base_size/22
)Arguments
- base_size
The base font size for text elements. Defaults to 15.
- base_family
The base font family for text elements. Defaults to
"Ubuntu".- base_line_size
The default size for line elements, calculated as a proportion of
base_size. Defaults tobase_size / 22.- base_rect_size
The default size for rectangle elements, calculated as a proportion of
base_size. Defaults tobase_size / 22.
Theme Elements
The theme sets the text, axis, panel, and legend formatting:
Text elements use the
base_familyfontText sizes are set relative to
base_sizeAxis titles and text are positioned and sized for clarity
Tick marks are removed for a cleaner look
Panel grids use subtle lines
Strip text and backgrounds are styled to separate facets
The plot title, subtitle, caption, and tag are formatted for prominence and readability
Legends are simplified, with font sizes relative to
base_sizeand unobtrusive marginsThe plot margin is adjusted for a balanced layout
