How do I fill the color between two curves? I want to fill the area bounded by the curve above the horizontal line with one color, and the area bounded by the curve below the horizontal line with a second different color..
random_x = [-180, -160, -140, -100, -70, -40, -10, 20, 50, 80, 110, 120, 140, 165,175, 180]
random_y = [2000000, 700000, 2800000, 4200000, 1000000, 1200000, 3500000, 2000000, 800000, 3900000, 2500000, 1000000,3400000,2400000,2100000, 2000000]
interp1d_cubic = interp1d(random_x, random_y, kind='cubic')
x3 = np.linspace(-180, 180, 100000)
plt.plot(x3, interp1d_cubic(x3), c='k')
y_coord = np.linspace(980000,980000,100000)
plt.plot(x3, y_coord, c='k', linestyle='--')
plt.show()
The resulting current plot looks as follows: