Section 3.8 π‘ Reproducibility Tip:
With visualizations (especially in R) there are nearly limitless possibilities. To support reproducibility, aim to create figures that clearly communicate their purpose even when viewed on their own.
When creating a visualization, ask yourself:
-
What question is this visualization answering?
-
What do I want my audience to understand from it?
-
What would someone understand if they saw this figure without any surrounding text?
To help close the gap between these questions, use informative labels and captions, that will help guide users on what theyβre seeing.
Within
ggplot2, functions like labs() allow you to clearly label axes, titles, and legends so the intent of the plot is immediately clear. When working in R Markdown or bookdown (Graphs), figure captions (using fig-cap) provide additional context that travels with the figure wherever it appears.
Visualizations that are well-labeled and properly captioned are easier to interpret, reuse, and reproduceβboth by others and by your future self.
