ggplot: remove lines at ribbon edges

后端 未结 4 1308
别跟我提以往
别跟我提以往 2021-02-11 12:19

I am using ggplot to plot time course data (fixation proportions over time to different objects on the screen) and want to use a ribbon to show the SE, but the ribb

4条回答
  •  迷失自我
    2021-02-11 13:01

    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

提交回复
热议问题