Topics Covered

Custom Theme Building

Build a reusable ggplot2 theme from scratch — typography, gridlines, captions, and legend control with theme_minimal().

Jittered Dot Plots

Use geom_point() with position_jitterdodge() to reveal distributions within groups, avoiding overplotting.

Factor Reordering

Sort categorical axes by computed statistics using fct_reorder() — e.g. by gender gap in median bill length.

Polished Figures

Overlay median markers, connector lines, and HTML-styled subtitles with ggtext to eliminate legends entirely.

Key Concepts

Scripts

📄 penguins_stepbystep.R

Build up the final plot step by step — data prep, jitter layer, median points, connector lines, custom theme, and ggsave export.

Download →

📄 raincloud_penguins_final.R

Advance your visualization skills with raincloud plots — combining density distributions, raw data points (jitter), and summary statistics into a single high-impact figure.

Download →

Visual Output

Penguin bill length comparison by species and sex

Chinstrap penguins show the strongest gender gap in bill length — generated by penguins_stepbystep.R

Raincloud plot of penguin bill ratio

Raincloud plots provide a comprehensive view of data distributions (density, raw data, and IQR) — generated by raincloud_penguins_final.R

Homework

📄 02_scatter_plots.R

Learn the grammar of graphics ecosystem and build scatter plots layer by layer mapping variables to visual aesthetics.

Download →

📄 03_boxplots.R

Build box plots, overlay raw data with jitter, and combine fill groups with jittered points to interpret distributions.

Download →

📄 04_styling.R

Understand how to apply and compare built-in themes, format axes, and compose a publication-ready chart from scratch.

Download →

📄 05_contest_msleep.R

A programming contest applying everything learned: data cleaning, scatter plots, faceted plots, and visual polish using the mammals sleep dataset.

Download →

Resources