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()
../_images/graph_fonctions_2_0.png
x = np.array([-1, 0, 1, 2])
y = x**2

plt.plot(x, y)
plt.show()
../_images/graph_fonctions_3_0.png
x = np.arange(-1, 2, 0.1)
y = x**2

plt.plot(x, y, '.')
plt.show()
../_images/graph_fonctions_4_0.png
x = np.linspace(-1, 2, 30)
y = x**2

plt.plot(x, y, '.')
plt.show()
../_images/graph_fonctions_5_0.png
x = np.linspace(-1, 2, 30)
y = x**2

plt.plot(x, y, '.-')
plt.show()
../_images/graph_fonctions_6_0.png