Exemple simple sur comment tracer une fonction avec pyplot de matplotlib:

import matplotlib.pyplot as pltimport numpy as npdef f(x):return x**5 - 5 * x**3 + 2 * xx = np.arange(-2.1,2.2,0.1)y=f(x)plt.grid()plt.xlim(-2.1,2.1)plt.ylim(-8.0,8.0)plt.title("Tracer une fonction avec matplotlib")plt.plot(x,y)plt.savefig('plot_function_matplotlib.png')plt.show()
Références
| Liens | Site |
|---|---|
| pyplot | matplotlib |
