import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.scatter(x, y, label='Données') ax.plot(x, y_pred, label='Droite de régression') plt.show()