Field between 3 functions
What need to change in that code because it doesn't work? In python it works good but in Sage show error.
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-5, 3, 0.01)
y_1 = 4 - x ** 2
y_2 = 3 * x
y_3 = x*0 + 3
y_4 = np.minimum(y_1, y_3)
plt.fill_between(x, y_2, y_4, where=y_2<=y_4, color='grey', alpha='0.5')
plt.plot(x, y_1, 'r')
plt.plot(x, y_2, 'b')
plt.plot(x, y_3, 'g')
plt.show()
In Notebook, Sage 8.9, Ubuntu
but maybe your question is about SageMath in the terminal? .in this case sorry I do not know how to print a figure in the terminal.
could you precise the OS, the Sagemath version, notebook or terminal please ?
I don't know how to change this code to work in Sagemath Notebook because when I paste this code it doesn't work and I saw errors..
Could you copy/paste the full error message that you obtain in the notebook?
Maybe you can show us the errors you got, like @vdelecroix asked you ?