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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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) 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. 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! There's something rather surprising about this plot - it appears that fair diamonds (the lowest quality) have the highest average price!