Change:
"Note that we’re mapping the density the y,..."
to:
"Note that we’re mapping the density to y,..."
This commit is contained in:
0solarfox0
2023-10-25 13:06:43 -07:00
committed by GitHub
parent afa7c5f53b
commit 8c596307f3

View File

@@ -372,7 +372,7 @@ ggplot(diamonds, aes(x = price, y = after_stat(density))) +
geom_freqpoly(aes(color = cut), binwidth = 500, linewidth = 0.75)
```
Note that we're mapping the density the `y`, but since `density` is not a variable in the `diamonds` dataset, we need to first calculate it.
Note that we're mapping the density to `y`, but since `density` is not a variable in the `diamonds` dataset, we need to first calculate it.
We use the `after_stat()` function to do so.
There's something rather surprising about this plot - it appears that fair diamonds (the lowest quality) have the highest average price!