Skip to content

Make weight a recognised aesthetic in stat_bin_2d #4666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ggplot2 (development version)

* `stat_bin_2d()` now correctly recognises the `weight` aesthetic
(@thomasp85, #4646)

* All geoms now have consistent exposure of linejoin and lineend parameters, and
the guide keys will now respect these settings (@thomasp85, #4653)

Expand Down
2 changes: 1 addition & 1 deletion R/stat-bin2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stat_bin2d <- stat_bin_2d
#' @usage NULL
#' @export
StatBin2d <- ggproto("StatBin2d", Stat,
default_aes = aes(fill = after_stat(count)),
default_aes = aes(weight = 1, fill = after_stat(count)),
required_aes = c("x", "y"),

compute_group = function(data, scales, binwidth = NULL, bins = 30,
Expand Down