for i in range(len(r)):
    plt.plot(r[i][0], r[i][1], c=(rgb_number(speeds[i]), 0, 1 - rgb_number(
        speeds[i])), linewidth=1)
plt.axis('off')
ax = plt.gca()
ax.set_xlim(0.0, width_of_im)
Remove padding from matplotlib plotting