---
# System prepended metadata

title: Intermediate/Advanced `ggplot2` Workshop Series 2024
tags: [workshops]

---

---
tags: workshops
---
# Intermediate/Advanced `ggplot2` Workshop Series 2024
###### tags: `ggplot2`, `workshop`, `teaching`

### Notes for 2025

- Possible to get info on attendees' ggplot experience levels

### TODO

- [x] (Kristina) Find collab for lecture 7
- [x] (Eric) Create repo for slides and move over last year's stuff
- [x] Choose dates (3 wednesdays in a row, first three weeks of June?)
    - junteenth is a wednesday though
    - **Finalized dates** Thursdays from 11-1 (June 6, 13, 20)
- [x] (Renata) Add events to website

## Title & description

Leveling up your data visualization skills with ggplot2

"Level up"?
"Unlocking the next level of ggplot2"

## Logistics

- Dates? (Or get feedback re: scheduling)
    - June weeks 1-3?
- Who is leading which session?
- 2 hours each again
- Create new repo for ggplot series and turn into website
    - Move 2023 session folders over to new repo
    - Create a folder for each year

## Advertising

**TODO**

- [x] (Eric) Create session 1 Zoom registration
- [x] (Renata) Create session 2 Zoom registration
- [x] (Kristina) Create session 3 Zoom registration
- [x] (Kristina) Finalize blurb
- [x] Finalize series website
- [x] Add 3 sessions to our group's website

**Blurb**

Have you created some basic plots using the R package ggplot2? Do you want to advance your understanding of how ggplot2 works, or improve your skills with visualization details? Then this workshop series is for you! 

This three-part series will teach you the skills to refine & expand your current ggplot2 skills so you can generate complex, publication-quality plots efficiently and reproducibly. We will cover: 1) the latest developments in and underpinnings of ggplot2, 2) principles of effective visual design and how to implement these in ggplot2, 3) and the ever-expanding landscape of extensions to create animated, geospatial, interactive, and other varieties of plots. These sessions are stand-alone, so feel free to attend any or all of them! 

Find registration link for all sessions on the website: https://cct-datascience.github.io/ggplot2-workshop-series/


## Content

**Series description:**

This three-part series will teach you the skills to refine & expand your current ggplot2 skills so you can generate complex, publication-quality plots efficiently and reproducibly. We will cover: 1) the latest developments in and underpinnings of ggplot2, 2) principles of effective visual design and how to implement these in ggplot2, 3) and the ever-expanding landscape of extensions to create animated, geospatial, interactive, and other varieties of plots. We will assume you have created basic plots in ggplot2, and are looking for ways to level up. These sessions are stand-alone, so feel free to attend any or all of them! 

### First session

- Title: Foundations of `ggplot2`
- Lead: Eric
    - include recent ggplot updates (why changing software is good! and how to stay on top of new stuff)
    - Start with the grammar of graphics (what is a scale, geom, stat, aesthetic, etc.?)
    - Ways to do more hands on? 
    - Maybe not getting quite into the weeds so much

In this workshop you'll gain a better understanding of the "grammar of graphics"—the theory underlying many data visualization tools, including ggplot2. Using practical examples, you'll learn how understanding the grammar of graphics can help you build more creative, complex, information-rich visualizations.

### Second session

- Title: Crafting Professional Quality Data Visualizations With ggplot2
- Lead: Renata
    - First half hour to design principles; hopefully guest collaborator to do [lecture 7](https://drive.google.com/file/d/13r5lDMEtWTDnBEiaCI5juUOSwmainx0L/view) of Josh Levine's course: 
    - Do in a fairly hands on way
    - Include a script ahead of time
    - Remove `patchwork` (move to third session) (instead maybe simply include `labs(tag = "A")`)

In this session, we will introduce principles of effective data communication and learn how to use ggplot2 customizations to create professional-quality visualizations. We will include customized color schemes, annotations and legends, and exporting figures to publication-quality formats. 

#### Collaborator content

*Devin's initial outline*

From email: "My next steps are going to be putting this into a reveal.js slide deck (using a mark down file), and then fleshing out the individual sections."

 2024-05-21
ideas
* cover some of the principles from tufte's material
      * maximizing data ink ratio
      * maximize data density 
            * shrinking grphics
            * splitting a single chart into multiple 
                  * using faceting for small multiples
      * minimizing "lie factor"
* showing data variation not design variation
      * need to flesh this out more 
* talk about efficient and effect choices for marks and channels
      * methods for encoding data
* introduce the data to vis flow chart
* hand drawing activity based on a few presented tables of data
      * aim is that the participants attempt to match a visualization to the type of data
      * ask them for more than 1 sketch

40 minute span
* first 20 mins
      * tufte material
      * and marks and channels (most efficient choices for human visual system)
* 10 mins 
      * data to vis flowchart
* 10 mins hand drawing activity
      * 5 mins to draw,
      * 5 mins to share 


Connections with the code later
* showing them how to adjust how data can control position or color, and how with ggplot there's a grammar of graphics that matches the way different elements are added to the chart mapping data to "marks and channels"
* maximizing data ink ratio
      * show them how to remove fills on bars
      * demonstrate how to change opacity of grids so that they  "remove" ink rather than add it
* maximizing data density
      * demonstrate ggplot faceting
      * do a sparklines demo
* experiment with multiple graph types to determine which matches the data variation best with the least emphasis on design variations not supported by data
      * go through the data to vis chart, and for one node try several charts worth of code 
      * ask the students to compare and contrast the representations
      * this highlights also the iterative and collaborative nature of data visualization development 



### Third session (extensions): 


- Slide changes to make
    - Start with asking everyone what extensions they use
    - Expand the extensions categorization slide to include other purposes/categories of extensions
- Lead: all of us for different extensions?
    - Move multipanel stuff to here (`patchwork`)
    - Take out esquisse & plotly
    - Add in ggdist, maybe spatial? 
    - Extensions list
        - Eric: `patchwork`
        - Kristina: `gganimate`
        - ~~`marquee`~~
        - ~~`ggiraph`~~
        - ~~`tidyterra`~~
        - ~~Adding labels for stats tests? Just mention `ggstatsplot`~~
        - Renata: Section on extensions that do additional geoms with a few examples: `ggraph` (mention dendrograms), ~~`ggridges` `gggenes`~~ `ggdist`
    - At end, tell people they can stick around and try some of these and we can help 
    - A lot of the more unusual graphs that require extensions can be found using data to viz website
- Each of us make our own slides by Tuesday EoD and then Eric will pull them together Wednesday

There are over 100 packages that extend the functionality of ggplot2 to allow you to make just about any data visualization you can think of! In this workshop we'll cover a few of our favorite extensions, such as for multi-panel figures and animating visualizations, and show you how to find the ggplot2 extension that meets your data visualization needs.

gganimate notes: 
- Basically takes multiple plots made in ggplot and puts them together into an animation
- Quote from Thomas Lin Pedersen
- `transition` verbs to choose what to transition between
- `shadows` to include data besides what is currently being shown, can see changes
- `ease`, `enter`, and `exit` to customize how transition happens
- `view` to determine range shown
- Can save as gif, also can use different renderers
Takeaways
- Lots of customization possible
    - Verbs can do a lot: change or vary speed between states, range of axes displayed, how much past data is shown
- Can take a bit to get what is possible
- Also slow to render, which makes playing around with it less ideal



## Advertising

ask participants about scheduling? No (Kristina talked herself out of this as an actually bad idea) market more together

- Describe as a series; emphasize modularity
- 