and the Critique

J. Hathaway

Becoming the Critic.

Visualization of the Day

Review

Case Study 3: Becoming a databender

Take 10 minutes to brainstorm with your table what the data inputs are and what visualizations you would like to create?

  • What mutations or summaries will you need to do?
  • What difficulties do you expect?
  • Do each of the task items make sense?

Task 6: Developing a graphic

Providing Critiques and the Routine

A few critique examples

The Graphic Tool Set

The grammar of graphics

Cleveland’s Examples

There were three democratic candidates. We are going to use the following plots to help us understand the constituency that helped the winner in the primaries.

Class Activity: Getting Started

Get the above code working. We will be tweaking it using ggplot for the next part.

Labelling the outside

Complete the following - Create clean labels for the x and y axes and zoom in on the y-axis from 50 to 100 minutes. Also have breaks every 15 minutes

  • labelling - Axes, Titles, and Legends
  • xy Scales - scale_x_, scale_y, coord_ - Setting breaks and changing labels or Transforming scale

Labelling the inside

Complete the following -

  1. Color the points of fl_sc by origin using the brewer scale.
  2. Color the points of fl_sc by arr_delay**
  • color & fill scales
    • scale_color_
    • scale_fill_
    • scale_gradient_

Putting the legend on the inside

Complete the following - 1) Color the points of fl_sc by origin using the brewer scale and use the directlabel package to move the labels into the plotting region.

Changing the feel

Complete the following - Use a theme_() to create a different look for your graphic and change the orientiation of the x-axis test to 35 degrees

  • Themes (check out library(ggthemes))
  • ggsave()

Scales

Each of the aesthetics has a paired scale function - x, y, size, color, fill, linetype, shape, alpha. All of the scales start with scale_ and then the respective aesthetic. All the aesthetic scales have an _continuous, _discrete, and _manual.

  • scale_x_ & scale_y_ are the two scales I most often use
  • scale_fill_ & scale_color_ are the next most often used.
    • manual()
    • gradientn()

Labelling Elements inside the graphic

The library(ggrepel) package is a must for our work. library(directlabels) can also be helpful. Here is the book’s graphic.

  • What are some concerns you have with this graphic?

Code and graphic (scales)

Here is the book’s graphic.
Use the code from 28.3 and update their graphic to match mine.

My Code Solution

Displaying multiple distributions

Clarity vs. Complication

Data can get complicated very fast. How do we provide depth of variability understanding without overwhelming the visualization user?

Another package that makes flipping the axes easier in ggplot – rotating axes (ggstance)

Clarity vs. Complication (2)

  • What do we know after looking at this plot? How do we provide depth of variability understanding without overwhelming the visualization user?

Remember, data can get complicated very fast.

Distribution background

Histograms (1)

What don’t we like about this plot?

Histograms (2)

  • What changed in this histogram?
  • What don’t we like about this plot?

Boxplots

  • What don’t we like about this plot?
  • How hard is it to explain?

Violin plots

  • What don’t we like about this plot?
  • How hard is it to explain?

Beeswarm plots (1)

  • What don’t we like about this plot?
  • How hard is it to explain?

Beeswarm plots (1)

  • What don’t we like about this plot?
  • How hard is it to explain?

Letter-Value boxplots (1)

  • What don’t we like about this plot?
  • How hard is it to explain?

Letter-Value boxplots (2)

  • What don’t we like about this plot?
  • How hard is it to explain?

Letter-Value boxplots (3)

  • What don’t we like about this plot?
  • How hard is it to explain?

Thursday Classes

Art Class

The Wilderness of Data

Small Challenge

  • Use geom_violin() and geom_quasirandom() with the nycflights13::flights data to show some variable distributions.