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')
Matplotlib: linewidth is added to the length of a line