When I draw a line segment in matplotlib the linewidth seems to be added to the length of the line. Below my code (not the most pythonic code, but it should do the trick). A
It looks like the default solid_capstyle is projecting, which isn't the one you want:
plt.figure()
plt.plot([0, 100], [5, 5], linewidth=50, linestyle="-", c="blue",
solid_capstyle="butt")
plt.plot([0, 100], [15, 15], linewidth=50, linestyle="-", c="red",
solid_capstyle="round")
plt.plot([0, 100], [25, 25], linewidth=50, linestyle="-", c="purple",
solid_capstyle="projecting")
plt.axvline(x=100, c="black")
plt.xlim(0, 125)
plt.ylim(0, 30)
plt.savefig("cap.png")
