I have some data that is constrained below a 1:1 line. I would to demonstrate this on a plot by lightly shading the area ABOVE the line, to draw the attention of the viewer
As far as I know there is no other way other than creating a polygon with alpha-blended fill. For example:
df <- data.frame(x=1, y=1)
df_poly <- data.frame(
x=c(-Inf, Inf, -Inf),
y=c(-Inf, Inf, Inf)
)
ggplot(df, aes(x, y)) +
geom_blank() +
geom_abline(slope=1, intercept=0) +
geom_polygon(data=df_poly, aes(x, y), fill="blue", alpha=0.2) +
