Scientific workflows: Tools and Tips 🛠️
2026-05-21
📅 Every 3rd Thursday 🕓 4-5 p.m. 📍 Webex
So many things you can tune:
Different outputs (poster/talk/journal figure) require different tweaks
We’ll focus on:
Note
This is not an exhaustive list, there is so much more ggplot extension packages and tricks out there.
.Rproj file → opens in RStudio
install_packages.R to install today’s packagesRepo: https://github.com/selinaZitrone/advanced-ggplot-workshop
Add a theme_*() layer and the whole look changes.
theme()A theme controls everything that isn’t data: Fonts, sizes, colours, grid lines, spacing, legends, …
theme elementstext ──┬── axis.text ──┬── axis.text.x
│ └── axis.text.y
├── plot.title
├── plot.subtitle
└── legend.text
line ──┬── axis.line ──┬── axis.line.x
│ └── axis.line.y
├── axis.ticks
└── panel.grid ─── panel.grid.major / minor
rect ──┬── plot.background
└── panel.background
text once and every piece of text updatesOpen demo/01_themes.R
✏️ Exercise (~7 min):
Open
exercises/01_themes_exercise.R
Use colours your reader already associates with the thing.
For scientific figures:
Qualitative
Distinct categories
Sequential
Ordered, low to high
Diverging
Above / below a midpoint
A colourblind-safe qualitative palette, built into base R.
palette.colors(palette = "Okabe-Ito")Perceptually uniform, colourblind- and greyscale-safe. Best for ordered or continuous data.
scale_colour_viridis_d() / _c()Perceptually uniform and colourblind-safe. Made for scientific data and designed to be fair, readable, and citable
scale_colour_scico_d() / _c()Open demo/02_color.R.
✏️ Exercise (~5 min):
Open
exercises/02_color_exercise.R
The patchwork documentation is excellent
Open demo/03_patchwork.R.
✏️ Exercise (~8 min):
Open
exercises/03_patchwork_exercise.R
Starting points for Canvas and font sizes:
| Outlet | Canvas width | base_size |
|---|---|---|
| Paper, single column | ~89 mm | 8–10 |
| Paper, double column | ~120–180 mm | 10–12 |
| Slide, half | ~150 mm | 14–16 |
| Slide, full | ~250 mm | 18–22 |
| Poster | depends on layout | 18–24 |
Open demo/04_export.R.
✏️ Exercise (~7 min):
Open
exercises/04_export_exercise.R
The official ggplot extension gallery lists ~120 community extension packages to browse
gghighlightgghighlight to fade data and highlight specific elements.
ggrepel + ggtextggrepel and ggtext for labels and markdown text
library(ggrepel)
library(ggtext)
ggplot(gap_continent, aes(year, mean_lifeExp, color = continent)) +
geom_line(linewidth = 1) +
geom_text_repel(
data = gap_continent |> filter(year == max(year)),
aes(label = continent),
size = 6,
nudge_x = 2,
hjust = 0,
direction = "y",
seed = 1
) +
scale_x_continuous(expand = expansion(mult = c(0.02, 0.15))) +
scale_color_scico_d(palette = "batlow") +
# use markdown in the title (see theme layer)
labs(
title = "*Life expectancy* by **continent**",
x = "Year",
y = "Life expectancy"
) +
theme_workshop() +
theme(
panel.grid.major.x = element_blank(),
plot.title = element_markdown(),
legend.position = "none"
)ggdist raincloud plotsggdist to show distributions and uncertainty -> Barplot alternatives
library(ggdist)
ggplot(
gap_2007 |> filter(continent != "Oceania"),
aes(continent, gdpPercap, fill = continent)
) +
stat_halfeye(
adjust = 0.5,
width = 0.6,
.width = 0,
justification = -0.3,
point_colour = NA
) +
geom_boxplot(width = 0.15, outlier.shape = NA, alpha = 0.5) +
stat_dots(side = "left", justification = 1.1, dotsize = 0.4) +
scale_y_log10(labels = label_dollar(accuracy = 1)) +
scale_fill_scico_d(palette = "batlow") +
theme_workshop() +
theme(legend.position = "none")ggridgesggridges for ridgeline distribution plots
library(ggridges)
ggplot(gap_2007 |> filter(continent != "Oceania"), aes(lifeExp, continent, fill = continent)) +
geom_density_ridges(alpha = 0.8, scale = 1.1) +
scale_fill_scico_d(palette = "batlow") +
theme_workshop() +
theme(legend.position = "none") +
labs(x = "Life expectancy (years)", y = NULL)What you can take back to your own plots:
theme_*() function, source it, theme_set() it everywhere it’s neededcvdPlot()patchwork, collect shared legends, add tag panels, …ggview::canvas(), tweak base_size and geoms, and save with ragg::ragg_png or cairo_pdf.📅 18.06.2026 🕓 4-5 p.m. 📍 Webex
🔔 Subscribe to the mailing list
📧 For topic suggestions and/or feedback send me an email
Questions?
Selina Baldauf // Publication-ready ggplot2