The objective of this assignment is to get hands on with the 3 implementations of the Grammar of Graphics. In the previous modules you have seen how the same bubble chart can be produced in Vega-Lite, ggplot2 and Observable Plot. But you can only really learn to use these tools by making more and other visualisations with them yourself.
For each of the 3 tools, an example data set is provided below, just as some instructions to get started. If you run into any issues with any of the tools, please post them as comments on this page.
For this assignment you are expected to make visualisations with any of the 3 tools based on the Grammar of Graphics. The assignment is also meant as an exercise in using the power of Grammar of Graphics based tools: it is very easy to change the used geometries, or change and edit the used aesthetic mappings. So you should try to experiment a lot with the geometries and aesthetics: you will quickly end up with plots that are very hard to produce with chart template based tools.
Post images of the more interesting plots in the submission section below.
For Vega-Lite, the provided data set contains daily weather observations for Seattle for the period 2012 - 2015. The variables in the data set are precipitation
, temp_max
, temp_min
, wind
and weather
.
You can load the data into the Vega-Lite online editor with
"data": {"url": "data/seattle-weather.csv"},
To get you started, here is a link to the editor with a small Vega-Lite specification based on the Seattle weather data. Try to modify this specification to make other plots (by adding and changing encodings, by applying transforms (like binning) in the encoding, …). This tutorial can be a source of inspiration for that, just as the Vega-Lite examples gallery.
Remember that you can export the specification you wrote by clicking the “Export” button at the top of the editor. This is also a good way of exporting your visualisations as a png file.
For ggplot2, you are going to work with the Palmer penguins data set. This data set contains 7 variables collected from penguins at the Palmer Station on Antarctica. For each penguin, the following measurements were collected:
species
: one of the 3 species the measurements were collected from (Adelie, Chinstrap or Gentoo penguins)island
: the name of the island where the penguin was caught and measuredbill_length_mm
bill_depth_mm
flipper_length_mm
body_mass_g
sex