ggplot: remove lines at ribbon edges

You can remove the border using the colour argument:

ggplot(d, aes(Time, y, color = Object, fill = Object)) +
  geom_line(size = 2) +
  geom_ribbon(aes(ymin = lower, ymax = upper), alpha = .3, colour = NA)


geom_ribbon understands linetype aesthetic. If you want to map linetype to a variable include it in the aes() argument, otherwise, place linetype outside and just give it 0, like so:

ggplot(d, aes(Time, y, color = Object, fill = Object)) +
  geom_line(size = 2) +
  geom_ribbon(aes(ymin = lower, ymax = upper), linetype = 0, alpha = .3)

More info here: http://docs.ggplot2.org/current/geom_ribbon.html

Tags:

R

Ggplot2