from matplotlib.pyplot import plot, show, grid, ylim
from numpy import linspace

ylim(-5,5)
grid()

x = linspace(-3,-0.1, 1000)
y = 1/x
plot(x,y,color='blue')

x = linspace(0.1,3, 1000)
y = 1/x
plot(x,y,color='blue')


# partie de la courbe telle que -2 < 1/x < 2

x = linspace(-0.5,-0.01, 1000)
y = 1/x
plot(x,y,color='red')

x = linspace(0.01,0.5, 1000)
y = 1/x
plot(x,y,color='red')

# fin de la représentation de la partie de la courbe

show()
