PS: If you only want to show the positive part, you could use the where
parameter:
y0 = slope0 * x intercept0
plt.fill_between(x, y0, 0, where=y0 >= 0, interpolate=True, color='yellow')
plt.axhline(0, color='black') # shows the x-axis at y=0
PS: If you only want to show the positive part, you could use the where
parameter:
y0 = slope0 * x intercept0
plt.fill_between(x, y0, 0, where=y0 >= 0, interpolate=True, color='yellow')
plt.axhline(0, color='black') # shows the x-axis at y=0