Skip to content

Width argument to geom_errorbar not passed on when using stat_summary_bin #4647

@hummuscience

Description

@hummuscience

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions