Exercises
Data
You can either use the cats_uk and cats_uk_reference data that are used in the examples, or you can use a different dataset of your choosing. This might be a dataset that you are currently working with, or something new e.g. from the TidyTuesday datasets. A dataset about people awarded the Nobel Prize for physics, called nobel_physics, is provided below for convenience.
Cats
Download cats_uk CSV: cats_uk.csv
Download cats_uk_reference CSV: cats_uk_reference.csv
Nobel Laureates (Physics)
Download nobel_physics CSV: nobel_physics.csv
Exercise 1
- Load a dataset.
- Explore the variables.
- Think about what type of chart you might want to make.
- Optional: Sketch some ideas.
Note: If you don’t feel that comfortable with
ggplot2yet, feel free to look at the Examples page and simply run the code that’s already there. You can then play around with code and make some edits instead.
Exercise 2
- Perform any data wrangling required to make your plot
- Create a basic plot with
ggplot2 - Set an appropriate size.
Exercise 3
- Choose an appropriate colour palette. Is it accessible?
- Choose an appropriate font.
- Apply the colours and fonts to your chart.
For journal papers, you might want to use something similar to the font used for text the journal.
Exercise 4
- Add appropriate text for the title, subtitle, and caption
- Add annotations
- Is there anything else about your plot you would change?