How to make endpoints flush with fill in ListLinePlot?

If one plots a filled line plot such as, for example, the one produced by

ListLinePlot[{{{0, 0.6}, {0.5, 0.6}}, {{0.5, 0.3}, {1, 0.3}}},
Filling -> Axis, PlotStyle -> AbsoluteThickness[10],
AspectRatio -> Automatic, PlotRange -> {Automatic, {0, 0.8}},


the ends of the plot's lines have a rather noticeable "overhangs" beyond the fill regions below. How can I make this line be flush with the fill?

-

What you're seeing are the ends of the lines or the "caps" and because of the high thickness that you've specified, its presence is obvious. The solution here is to add CapForm -> None to the PlotStyle, which should give you the following plot.

The following example shows the effect of the caps more clearly:

With[{caps = {None, "Butt", "Round", "Square"}},
Graphics[
{
{Opacity[0.3], CapForm[#], AbsoluteThickness[10], Line[{{0, 0}, {1, 0}}]},
{Red, Point[{{0, 0}, {1, 0}}]}
},
Axes -> {True, False}, AspectRatio -> 1/10, PlotRange -> {{-0.1, 1.1}, Automatic},
ImageSize -> 300, PlotLabel -> ToString@#
] & /@ caps
] // Column


-
Thanks for that! And also for editing the question to show the image. Did you use some image uploader (other than this one)? –  kjo Jul 21 at 20:04
@kjo That version is broken due to a change in SE's internal stuff (undocumented), which is beyond our control. Halirutan has a fix for it, which you can install (see the readme). It's still the same application as Szabolcs', looks and works the same. –  rm -rf Jul 21 at 20:15
Wow! That uploader rocks! Thanks for the pointer! –  kjo Jul 21 at 20:37