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
ggplot2
's geom_ribbon()
now includes an outline.type
argument that helps control how the ribbon outlines are displayed.
library(tidyverse)
huron <- tibble(year = 1875:1972, level = as.vector(LakeHuron))
huron %>%
ggplot(aes(year, level)) +
geom_ribbon(aes(ymin = level - 1, ymax = level + 1),
fill = "grey70", color = "red",
outline.type = "lower") +
geom_line(aes(y = level))
Created on 2020-05-28 by the reprex package (v0.3.0)
Alternatively, as suggested we can set linetype = 0
to remove all lines.
library(tidyverse)
huron <- tibble(year = 1875:1972, level = as.vector(LakeHuron))
huron %>%
ggplot(aes(year, level)) +
geom_ribbon(aes(ymin = level - 1, ymax = level + 1),
fill = "grey70", color = "red", linetype = 0) +
geom_line(aes(y = level))
Created on 2020-05-28 by the reprex package (v0.3.0)