Skip to content
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

stat_summary_bin expects some binning arguments (e.g., bins) but not others (e.g., breaks) #2214

jwdink opened this issue Jul 19, 2017 · 1 comment


Copy link

@jwdink jwdink commented Jul 19, 2017

I'd like to pass "breaks" to stat_summary_bin, but this doesn't seem to work as expected, despite other binning arguments working.

df <- data.frame(x = rnorm(1000), y = rnorm(1000))

ggplot(df, aes(x = x, y = y)) + stat_summary_bin(breaks = seq(-3, 3, by = 0.5))
#> Warning: Ignoring unknown parameters: breaks
#> No summary function supplied, defaulting to `mean_se()
#> Warning: Removed 1 rows containing missing values (geom_pointrange).

ggplot(df, aes(x = x, y = y)) + stat_summary_bin(bins = 12)
#> No summary function supplied, defaulting to `mean_se()

Copy link

@karawoo karawoo commented Jul 24, 2017

StatSummaryBin takes bins and binwidth arguments, but not breaks. A workaround could be:

ggplot(df, aes(x = cut_width(x, 0.5, center = 0), y = y)) +

karawoo added a commit to karawoo/ggplot2 that referenced this issue Jul 27, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants