You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
new geom suggestion: separate lines for upper and lower intervals #3503
So instead of having to use geom_line twice, you could instead do
ggplot(df, aes(year, y, ymax=upper_y, ymin=lower_y)) + geom_errorline()
and this would fit more neatly into the idea of mapping the upper and lower intervals to the ymin and ymax aesthetics.
I imagine there's a way to achieve that same plot with geom_ribbon or geom_area but I haven't been able to do so so I'm guessing it wouldn't be straightforward even if there is.
I imagine there's a way to achieve that same plot with geom_ribbon or geom_area but I haven't been able to do so so I'm guessing it wouldn't be straightforward even if there is.
I agree with you. I don't come up with some nice idea for now, but I don't think we need a new geom as this won't be so difficult. e.g.
I'd thought of it as a geom since I was thinking the more common use case would be one where the upper/lower bounds are provided in the data (e.g. confidence intervals from a model that has been passed through broom::tidy(model, conf.int = TRUE)) rather than being a transformation. It would also be more directly analogous to the other "interval" geoms like geom_errorbar or geom_ribbon, and therefore maybe more intuitive?
I mean, it's just an implementational detail that GeomRibbon draws polygons, and it might be able to draw lines and polygons separately. For example, 017992b:
Just to make sure we're on the same page, are you asking if I've seen someone use geom_ribbon with a transparent fill but they still want the polygon? I don't think I've seen that before.
Activity
yutannihilation commentedon Aug 29, 2019
I agree with you. I don't come up with some nice idea for now, but I don't think we need a new geom as this won't be so difficult. e.g.
Created on 2019-08-29 by the reprex package (v0.3.0)
weiyangtham commentedon Aug 30, 2019
I'd thought of it as a geom since I was thinking the more common use case would be one where the upper/lower bounds are provided in the data (e.g. confidence intervals from a model that has been passed through
broom::tidy(model, conf.int = TRUE)) rather than being a transformation. It would also be more directly analogous to the other "interval" geoms likegeom_errorbarorgeom_ribbon, and therefore maybe more intuitive?yutannihilation commentedon Sep 2, 2019
Now I come to wonder if we can just write this with
geom_ribbon():I mean, it's just an implementational detail that
GeomRibbondraws polygons, and it might be able to draw lines and polygons separately. For example, 017992b:Created on 2019-09-02 by the reprex package (v0.3.0)
I'm not sure if this really will be an acceptable change, though...
weiyangtham commentedon Sep 4, 2019
Something like this would be great. Is the worry that users might expect
geom_ribbon()to always draw polygons?yutannihilation commentedon Sep 5, 2019
I expected there's effectively no such users, but I'm not fully sure... Just curious, have you ever seen such a usage?
weiyangtham commentedon Sep 5, 2019
Just to make sure we're on the same page, are you asking if I've seen someone use
geom_ribbonwith a transparent fill but they still want the polygon? I don't think I've seen that before.yutannihilation commentedon Sep 5, 2019
Yes, that's what I meant to ask. Thanks.