Session Objectives and Transferable Skills

  • Understand how to apply good data visualisation techniques to publishable plots
  • Understand the flexibility of ggplot, and how to utilise this flexibility in producing publishable plots
  • Using the tidyverse, in particular ggplot2
  • Advanced functions in ggplot, relating to specific graphical customisation
  • Creating standardised plots for publication

Schedule

  • Introduction (5 minutes)
  • Part 1: (40 minutes)
    • Specifying the visual plotting space with themes
    • Specifying plotting axis’s
  • Break (5 minutes)
  • Part 2: (35 minutes)
    • Specifying labels, titles and other annotations
    • Specifying layouts: ggarrange vs facet_grid
  • Review and Conclusion (5 minutes)

Part 1

Specifying the visual plotting space with themes

  • Using foundation theme()
    • Line elements: element_line()
    • Rectangular elements: element_rect()
    • Text elements: element_text()
  • Using presets
    • theme_bw()
    • theme_classic()
    • theme_dark()
    • theme_light()
    • theme_minimal()
    • theme_void()

Specifying the axis’s

  • Simple Shortcuts:
    • lims(x = c(min, max), y = c(min, max))
  • Advanced Used
    • scale_x_continuous() / scale_y_continuous()
    • scale_x_sqrt() / scale_y_sqrt()
    • scale_x_log10() / scale_y_log10()
  • Internal Arguments
    • breaks, minor_breaks, n.breaks
    • labels, limits

Part 2

Specifying Labels

  • Simple Shortcuts
    • labs()
  • Internal Arguments
    • title, subtitle, caption
    • x, y
  • Advanced Used
    • annotate(): geom (“text”, “rect”, etc), x, y, label
    • geom_vline: xintercept
    • geom_hline: yintercept

Specifying Layouts

  • facet_grid()/facet_wrap()
  • rows / cols = vars(named variable)
  • ggarrange
  • ncol / nrow = numeric value
  • …, = stored data variable
  • common.legend = TRUE/FALSE

Questions, Comments and More

  • Find me online: thomasjwise.com
  • Email me: thomas.j.wise@outlook.com
  • Connect with me: www.linkedin.com/in/tjwise213/
  • Follow me: @thomasj_wise