Home > Software design >  Matplotlib fill_between function using axline as input generates TypeError
Matplotlib fill_between function using axline as input generates TypeError

Time:11-02

I'm attempting to use an fill_between up till a diagonal line

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

fill between, only showing positive part

  • Related