我不得不翻转我的线的轴,但仍然需要geom_area
在曲线下。但是我不知道如何做到这一点。
这是我试过的代码行
ggplot(PalmBeachWell, aes(x=Date, y=Depth.to.Water.Below.Land.Surface.in.ft.)) +
geom_area(position= "identity", fill='lightblue') +
theme_classic() +
geom_line(color="blue") +
scale_y_reverse()
这是我得到的
1条答案
按热度按时间shyt4zoc1#
一个选项是使用
geom_ribbon
填充曲线上方的区域,在应用scale_y_reverse
之后,将导致曲线下方的填充。使用基于
ggplot2::economics
数据集的一些伪示例数据: