Open davidhodge931 opened 1 week ago
To be more precise, I think what you're requesting is that geom_abline()
is clipped to the plot panel in both the x and the y directions. I think this is a reasonable request.
Slightly simpler reprex:
library(ggplot2)
ggplot() +
geom_abline(colour = "blue", slope = 0.1) +
geom_abline(colour = "red", slope = 6) +
coord_cartesian(clip = "off") +
xlim(-2, 2) + ylim(-2, 2) +
theme(plot.margin = margin(50, 50, 50, 50))
Created on 2024-09-06 with reprex v2.0.2
Following on from https://github.com/tidyverse/ggplot2/issues/6081
This would be helpful, as abline is always needed in the panel - and then you would have the flexibility to adjust the scale and coord settings without adversely affecting the abline.
Currently it does on the x, but not on the y.
Created on 2024-09-07 with reprex v2.1.1