-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Width argument to geom_errorbar not passed on when using stat_summary_bin #4647
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
Comments
Yeah, this is an unfortunate consequence when stats and geoms share an aesthetic or parameter name. Fixing this will be surprisingly difficult I'm afraid |
Is it because |
hum... that was my thinking writing this, but now I'm not so sure 😬 I'll have to dig in a bit more when I sit down to fix the issue |
If it is any help, I could try to dig for the reason. I don't think that I am at the level of actually writing a fix, but maybe I could find out what is causing it... |
That is very welcome 🙏 |
Ah, I can see where things run into each other. So, my initial hunch was correct, it was just a bit more complicated. I'm afraid we don't have a great solution for this at the moment. I'll keep this issue open to remind us to think about it |
You can use library(ggplot2)
iris |>
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
stat_summary_bin(
aes(width = after_stat(1)),
geom = "errorbar"
)
#> No summary function supplied, defaulting to `mean_se()`
#> No summary function supplied, defaulting to `mean_se()`
#> No summary function supplied, defaulting to `mean_se()` Created on 2024-03-28 with reprex v2.1.0 |
Should a parameter |
It is also a bit verbose the throw the warning about the summary function 3 times |
When using
stat_summary_bin
andgeom = "errorbar"
thewidth
argument used to set the width of the errorbars ingeom_errorbar
does not work.The below code produces the same plots with different setting for width
Related to follwing StackOverflow issue: https://stackoverflow.com/questions/42418746/how-to-adjust-width-of-errorbar-created-with-stat-summary-bin
Created on 2021-10-20 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: