import matplotlib.pyplot as plt
import numpy as np
import random
plt.rcParams["figure.figsize"]=[7.50,3.50]
plt.rcParams["figure.autolayout"]=True
x = np.linspace(1,10,100)
y = np.sin(x)
fig, ax = plt.subplots()for i inrange(0,100,5):
r = random.random()
b = random.random()
g = random.random()
color =(r, g, b)
ax.plot(x[i:i+5+1], y[i:i+5+1], c=color, lw=7)
plt.show()