Please add after ax.plot(a).
To remove horizontal padding
ax.margins(x=0)
To remove padding in both x and y
ax.margins(0)
Or to remove horizontal padding
ax.set_xlim(0, len(a)-1)
Output: