Session Ready
Exercise

Zooming In

In the video, you saw different ways of using the coordinates layer to zoom in. In this exercise, we'll compare zooming by changing scales and by changing coordinates.

The big difference is that the scale functions change the underlying dataset, which affects calculations made by computed geoms (like histograms or smooth trend lines), whereas coordinate functions make no changes to the dataset.

A scatter plot using mtcars with a LOESS smoothed trend line is provided. Take a look at this before updating it.

Instructions 1/2
undefined XP
  • 1

    Update the plot by adding (+) a continuous x scale with limits from 3 to 6. Spoiler: this will cause a problem!

    • 2

      Update the plot by adding a Cartesian coordinate system with x limits, xlim, from 3 to 6.