width is an aesthetic and a parameter of geom_errorbar (also worth nothing that it is not documented as either except in examples). Because of this dual classification, although you can set the default globally in update_geom_defaults, it actually has no effect. In fact, although the default is 0.5 what plots by default in the case below is a width of 0.9. The aesthetic or parameter must be set by the user explicitly for it to take effect given the way width is calculated in GeomErrorbar$setup_data(). This is also a problem with the height aesthetic of geom_errorbarh.
The simplest way (and perhaps the most consistent with other geoms) is to actually remove the width and height aesthetics from errorbar and errorbarh - leaving them only as parameters and removing the ability to set global defaults altogether, as width is in geom_boxplot (noted in #2245) or fatten is in geom_pointrange (discussed in #2798), but this will break any existing users' plots that map the width/height to some data value. As @clauswilke notes, there is no real technical reason to limit the aesthetics available to users; we just also need to make sure that they are globally updatable with existing functions which will require either making them simply aesthetics (not also calculated parameters) or, if it is desirable to have dual parameter/aesthetics, we will likely need to adjust the order in which default aesthetics are applied and setup_data is called - or some similar solution.
width
is an aesthetic and a parameter of geom_errorbar (also worth nothing that it is not documented as either except in examples). Because of this dual classification, although you can set the default globally inupdate_geom_defaults
, it actually has no effect. In fact, although the default is0.5
what plots by default in the case below is a width of0.9
. The aesthetic or parameter must be set by the user explicitly for it to take effect given the waywidth
is calculated inGeomErrorbar$setup_data()
. This is also a problem with theheight
aesthetic ofgeom_errorbarh
.Created on 2018-08-03 by the reprex package (v0.2.0).
The simplest way (and perhaps the most consistent with other geoms) is to actually remove the width and height aesthetics from errorbar and errorbarh - leaving them only as parameters and removing the ability to set global defaults altogether, as
width
is ingeom_boxplot
(noted in #2245) orfatten
is ingeom_pointrange
(discussed in #2798), but this will break any existing users' plots that map the width/height to some data value. As @clauswilke notes, there is no real technical reason to limit the aesthetics available to users; we just also need to make sure that they are globally updatable with existing functions which will require either making them simply aesthetics (not also calculated parameters) or, if it is desirable to have dual parameter/aesthetics, we will likely need to adjust the order in which default aesthetics are applied andsetup_data
is called - or some similar solution.