Working with Layouts and Composition

13:30-15:00

Date

July 26, 2022

View slides in full screen | Run the code yourself

Outline

  • Legend Placement and Styling
    • Discrete Legend
    • Continuous Legend
    • Legend Position
    • Legend Justification
    • Legend Direction
    • Legend Types
    • Legend Styling
    • Key Glyphs
  • Composing ggplot’s
    • The “Monsters” Example
    • {patchwork}
    • Apply Theming
    • Adjust Widths and Heights
    • Use a Custom Layout
    • Add Labels
    • Add Text
    • Add Inset Plots
  • More Legend Styling
    • Legend with Color Shading
    • Legend on Top
    • Resort Legend

Recap

  • guides are the combination of scales and legends
  • legends can be either modified with the guide_* function in scale_*() or guides() and with the theme() component qualitative
  • … while quantitative guides are colorbar, colorsteps or bins
  • {patchwork} is the most modern and simplest way to compose plots
    • use +, / and | to combine plots
    • use plot_layout() to adjust the layout, widths and heights
    • use plot_annotation() to add tags and general labels
    • use inset_element() to add inset graphics