Exercise 3: Visualization Design

Important

Please shutdown your RStudio session when you’re not using it.

In the past several exercises, you’ve typically been given a lot of template code and very specific instructions. This time, we’ll do some of the same tasks, but without the training wheels.

Make your own qmd file, following the Class Standards (especially regarding the YAML header). You may use past exercises as inspiration, but avoid copy and paste except for the text in Class Standards.

Part 1

Replicate this plot, made using the ridership data from the previous exercise. Write one or two sentences about what it tells you.

Part 2

Make another plot of the same variables as in Part 1, but choose a different mapping of variables to visual cues. Write a sentence about what is now easier, or harder, to see in this plot compared with the previous one.

Part 3

Now use the gapminder data; you may use the data from Plotly Express. The following code chunk also creates some filtered data frames that are needed for the following problems.

gapminder = px.data.gapminder()
just_usa = gapminder.query("country == 'United States'")

countries = [
  "China", "India", "United States",
  "Indonesia", "Brazil", "Pakistan",
  "Bangladesh", "Nigeria", "Japan"]

gapminder_9_countries = gapminder.query("country in @countries")

Make the following plot:

Part 4

Make two plots of the gapmind_9_countries data. Both plots should use year, lifeExp, and country, but one should use color for country and the other should use faceting (I suggest making the facets wrap). Compare and contrast the two plots: What is easier to see in one plot compared with the other?

Part 5

Replicate the Gapminder “health and wealth” plot – as much as you can.

Here’s what one might look like:

Reflection

At the end of your document, write a sentence or two of your overall reflections on this exercise. You may write whatever you want, but you might perhaps respond to one or two of these questions:

  • Was anything unclear about this assignment?
  • How hard was it for you? Where did you get “stuck”?
  • How long did it take you?
  • What questions or uncertainties remain?
  • What skills do you think you’ll need more practice with?
  • Did you try anything out of curiosity that you weren’t specifically asked to do?
Note

We’ll respond to these reflections in class, but only in an overall sense and only once we’ve had a chance to review them. If you have a question that needs a response, please post it on Perusall.

Submitting

Submit your rendered HTML file to Moodle. (Make sure it renders cleanly, and shows correctly on your computer.)