ggplot2: geom_smooth select observations connections (equivalence to geom_path())
问题 I am using ggplot2 to create vertical profiles of the ocean. My raw data set creates "spikes" so to make smooth curves. I am hoping to use geom_smooth() . I also want the line to progress according to the order of the observations (and not according to the x axis). When I use geom_path() , it works for the original plot, but not for the resulting geom_smooth() (see picture below). melteddf = Storfjorden %>% melt(id.vars = "Depth") ggplot(melteddf, aes(y = Depth, x = value)) + facet_wrap(~