Introduction to Graphics

We read…

Syntax basics

ggplot(data = <DATA>) +
  <GEOM>(mapping = aes(<MAPPINGS>), 
         position = <POSITION>,
         stat = <STAT>) +
  <FACET> +
  <COORD> +
  <THEME>
import seaborn as sns
import matplotlib.pyplot as plt

plot = sns.<plottype>(<MAPPINGS>)

plt.show() # Show the plot (for quarto)

Practice

  • What type of plot is it?
  • Which variables are mapped to x, y, and fill?
  • What is the main message of the plot: what is your main finding, i.e. what do you want viewers to learn from the plot?
  • Are there any anomalies or outliers?
  • (Extra question) Could you make this plot more effective? How?

Practice

  • What type of plot is it?
  • Which variables are mapped to x, y, and fill?
  • What is the main message of the plot: what is your main finding, i.e. what do you want viewers to learn from the plot?
  • Are there any anomalies or outliers?
  • (Extra question) Could you make this plot more effective? How?

Homework

  • Use github classroom to accept the assignment
  • Don’t forget committing and pushing the changes!