from matplotlib.pyplot import *
from numpy import *

# Définition de la fonction :
def f1(t):
    return sin(t)

def f2(t):
    return cos(t)

# Bornes du graphique, a<=x<=b  et  c<=y<=d :
a,b=-5,5
c,d=-2,2

# Tracé de la fonction :
x=linspace(a,b,200)
y=f1(x)
plot(x,y,label="y=f1(x)")
# z=f2(x)
# plot(x,z,label="y=f2(x)")

# Grille :
grid()

# Axes :
axhline(color="black")
axvline(color="black")
xlabel("x")
ylabel("y")

# Repère orthonormé :
# axis("equal")

# Fenêtre à afficher :
axis([a,b,c,d])

# Légende :
legend(loc="upper right")   # ou "lower left" etc.

# Affichage :
show()