โ† All activities
Recitation 1 ยท Visualization Practice

Visualization Practice: Make a practice visualization

An in-class activity from the course slides โ€” reproduced here so you can find it again after class.

๐Ÿ“‹ What to do

Slide for Visualization Practice: Make a practice visualization
  1. 1. Load in the diamonds dataset. This activity uses the same one the recitation code uses โ€” a 1,000-row sample of ggplot2::diamonds:
    diamonds = ggplot2::diamonds %>% sample_n(1000)
    (load library(ggplot2) and library(dplyr) first). If you would rather read a file, workshops/mydiamonds.csv in the course repository is a small 3-column alternative (price, carat, cut).
  2. 2. Pick 1-2 variables.
  3. 3. Make a histogram, scatterplot, or boxplot of them.
  4. 4. Map ~2 aesthetics and ~2 static attributes. An aesthetic is written inside the aes(...) phrase and names a vector in the data, so it varies by row; a static attribute is written outside aes() as a constant, so it applies uniformly to every point.
  5. 5. Submit your visual and code to CANVAS!
  6. 6. Be prepared to talk about your approach!

๐Ÿ“– Read alongside

R track: Visualization with ggplot in R โ€” the aesthetic-vs-static-attribute question is Learning Check 3. Python track: Visualization with plotnine in Python.

๐Ÿ“ฎ Submit

Submit your visual and code to CANVAS (1 pt) โ€” graded on completion.

Note: this page carries the live text of the activity, including the links to slides and shared materials; check back here if something looks out of date. Hand your work in on Canvas, which also carries the due date and your grade.