1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Visualization with ggplot2

Connected

Exercise

Overplotting 3: Low-precision data

You already saw how to deal with overplotting when using geom_point() in two cases:

  1. Large datasets
  2. Aligned values on a single axis

We used position = 'jitter' inside geom_point() or geom_jitter().

Let's take a look at another case:

  1. Low-precision data

This results from low-resolution measurements like in the iris dataset, which is measured to 1mm precision (see viewer). It's similar to case 2, but in this case we can jitter on both the x and y axis.

Instructions 1/3

undefined XP
  • 1
    • Change the points layer into a jitter layer.
    • Reduce the jitter layer's width by setting the width argument to 0.1.
  • 2

    Let's use a different approach:

    • Within geom_point(), set position to "jitter".
  • 3

    Provide an alternative specification:

    • Have the position argument call position_jitter() with a width of 0.1.