I am plotting a line L in a rectangular coordinate system. The coordinate system has grid lines. (I'm using \draw[help lines] (-5,-5) grid (5,5), so the grid lines form a 10-by-10 box for the coordinate system.) The line L is ultra thick. I have extended L to the edges of the grid lines. The problem is that when you zoom-in on those two points where L meets the boundary of the grid lines, the corners of the line caps for L extend slightly past the grid lines. Is there a way to plot L to the edges of the grid lines, only to have the line caps of L be cut off once it meets the grid lines? Basically, I want L extended to the grid lines, and I don't want anything--including the line caps for L--to go over top of and past the grid lines.
Choosing a good