MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Introduction to Data Visualization with ggplot2

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  # Swap for jitter layer with width 0.1
  geom_point(alpha = 0.5)
Edit dan Jalankan Kode