x = np.linspace(0, 10, 100)
y = np.cos(x)
thickness = 0.01 * x
plt.fill_between(x, y - thickness, y + thickness, color='blue')
plt.show()
How do you make the linewidth of a single line change as a function of x in matplotlib?