Chapter 3 Problem 3

Using the midwest dataset in the ggplot2 package. replicate the plot below using the following settings.

  • Map x = area and y = poptotal
  • Set alpha = 0.4
  • Set the limit of x-axis is c(0, 0.1)
  • Set the limit of y-axis is c(0, 500000)
  • Use se = FALSE option within geom_smooth() to remove confidence bands.
  • Use theme_classic()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## Warning: Removed 15 rows containing non-finite values (stat_smooth).
## Warning: Removed 15 rows containing missing values (geom_point).