I'm working on an R plot that will be separated into two parts by a vertical line I'm creating with abline()
.I would like that abline to go over the boundaries of my plot on one side only.
I found this helpful post about setting par(xpd=). However, I could not figure out how to get this command make the line go over the plot border on one side only, as outlined in the screenshot below.
Is there a way to do this in base R? (Or do I have to rebuild the whole thing in ggplot etc?)
I feel that the key might the differences between
figure region
,device region
, etc. but was unable to really determine the difference between those. I looked at this source but at least for my plot those settings seem to amount to the same thing - it would be cool if anyone had some help here as well!
Here's my approach:
plot(100, 100)
par(xpd=TRUE)
abline(v=70, lty=3)
And what I get / want:
Any help is appreciated!