Academic Figures: A Comprehensive Guide

Common Pitfalls and Best Practices

Author

Jan Stanstrup

Published

December 1, 2025

Welcome

This comprehensive guide covers common pitfalls and best practices for creating academic figures, with a focus on R and ggplot2.

Originally a Presentation

This material was originally created as a presentation, so some sections may be more concise or visually oriented than typical book chapters. The book format adds context, exercises, and additional explanations, but the core content prioritizes visual examples and practical demonstrations.

About This Guide

Scientific figures are often the first—and sometimes the only—thing readers look at in a paper. Poor quality figures not only look unprofessional but can also mislead readers and undermine your research. This guide will help you create clear, accurate, and publication-ready figures.

What You’ll Learn

This guide covers 11 essential topics:

Core Principles:

  1. Color Gradients - Why rainbow scales are problematic and what to use instead
  2. Heatmap Scaling - Handling outliers and choosing appropriate scaling methods
  3. File Formats - Vector vs raster, when to use PDF, SVG, PNG, or TIFF

Practical Workflow:

  1. Text Sizing - Making text readable at final dimensions
  2. Themes & Styling - Setting consistent, publication-ready styles
  3. Saving Plots - Using ggsave() properly with correct DPI and dimensions
  4. Post-Processing - When and how to edit exported figures

Advanced Topics:

  1. PowerPoint Import - Importing figures without quality loss
  2. Factor Ordering - Avoiding common sorting pitfalls
  3. Interactive Plots - Creating interactive visualizations with plotly
  4. Rendering Issues - Troubleshooting common problems

Three Ways to Learn

This material is available in multiple formats to suit different learning styles:

📊 Presentation Slides

Concise, visual presentation format perfect for:

  • Quick reference during analysis
  • Presentations and workshops
  • Getting an overview of key concepts

View the slides →

📖 Book Format (You’re Here!)

Comprehensive tutorial with the same content plus:

  • Detailed introductions and learning objectives
  • Summaries and key takeaways
  • Hands-on exercises
  • Further reading resources

Note: This book uses a single-source architecture. The same source files (topics/*.qmd) generate both the slides and book chapters, ensuring perfect consistency between formats.

✅ Interactive Quiz (Local Only)

Test your knowledge with 31 questions covering all topics! The quiz runs as an interactive R Shiny app, so it only works locally (not on the web). See the Quiz Information appendix for instructions.

Who This Guide Is For

  • Researchers preparing figures for publication
  • Graduate students learning data visualization
  • Anyone who creates plots in R
  • Workshop participants and instructors

Prerequisites

Basic familiarity with:

  • R programming
  • ggplot2 plotting
  • Data manipulation with dplyr/tidyr

Getting Started

Navigate using the sidebar on the left, or start with Chapter 1: Color Gradients. Each chapter is self-contained with code examples you can run yourself.