-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Labels
Description
When using stat_summary_bin
and geom = "errorbar"
the width
argument used to set the width of the errorbars in geom_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
library(tidyverse)
iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
stat_summary_bin(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()`
iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
stat_summary_bin(geom = "errorbar", width = 0.1)
#> No summary function supplied, defaulting to `mean_se()`
#> No summary function supplied, defaulting to `mean_se()`
#> No summary function supplied, defaulting to `mean_se()`
iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
stat_summary_bin(geom = "errorbar", width = 2)
#> 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 2021-10-20 by the reprex package (v2.0.1)