Fonctions en graphique
Fonctions en graphique#
import numpy as np
import matplotlib.pyplot as plt
x = np.array([-1, 0, 1, 2])
y = x**2
plt.plot(x, y, '.')
plt.show()
x = np.array([-1, 0, 1, 2])
y = x**2
plt.plot(x, y)
plt.show()
x = np.arange(-1, 2, 0.1)
y = x**2
plt.plot(x, y, '.')
plt.show()
x = np.linspace(-1, 2, 30)
y = x**2
plt.plot(x, y, '.')
plt.show()
x = np.linspace(-1, 2, 30)
y = x**2
plt.plot(x, y, '.-')
plt.show()