Skip to content

Commit 99bb87d

Browse files
committed
move (count / width) note to details
1 parent 3837d44 commit 99bb87d

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

R/geom-histogram.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#' one change at a time. You may need to look at a few options to uncover
1818
#' the full story behind your data.
1919
#'
20+
#' By default, the _height_ of the bars represent the counts within each bin.
21+
#' However, there are situations where this behavior might produce misleading
22+
#' plots (e.g., when non-equal-width bins are used), in which case it might be
23+
#' preferable to have the _area_ of the bars represent the counts (by setting
24+
#' `aes(y = after_stat(count / width))`). See example below.
25+
#'
2026
#' In addition to `geom_histogram()`, you can create a histogram plot by using
2127
#' `scale_x_binned()` with [geom_bar()]. This method by default plots tick marks
2228
#' in between each bar.

R/stat-bin.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#' density = "density of points in bin, scaled to integrate to 1.",
3232
#' ncount = "count, scaled to a maximum of 1.",
3333
#' ndensity = "density, scaled to a maximum of 1.",
34-
#' width = "widths of bins. Use with `after_stat(count / width)` to obtain bars with _areas_ representing counts (e.g., with non-equal-width bins). See example."
34+
#' width = "widths of bins."
3535
#' )
3636
#'
3737
#' @section Dropped variables:

man/geom_histogram.Rd

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)