Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| matplotlib [Le 18/10/2020, 21:05] 86.246.31.132 [Depuis les dépôts] | matplotlib [Le 11/09/2022, 11:39] (Version actuelle) moths-art Suppression des espaces en fin de ligne (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) | ||
|---|---|---|---|
| Ligne 7: | Ligne 7: | ||
| **Matplotlib** est une bibliothèque Python permettant de réaliser des graphiques en 2D et 3D | **Matplotlib** est une bibliothèque Python permettant de réaliser des graphiques en 2D et 3D | ||
| - | \\ | + | |
| ===== Pré-requis ===== | ===== Pré-requis ===== | ||
| Ligne 28: | Ligne 28: | ||
| ===== Utilisation ===== | ===== Utilisation ===== | ||
| - | Exemple d'un graphique en 2D (tiré de [[http://commons.wikimedia.org/wiki/File:Logarithmic_Spiral_Pylab.svg?uselang=fr|Wikipédia]] (licence domaine public)) | + | Exemple d'un graphique en 2D (tiré de [[https://commons.wikimedia.org/wiki/File:Logarithmic_Spiral_Pylab.svg?uselang=fr|Wikipédia]] (licence domaine public)) | 
| Créer un fichier et y coller le code : | Créer un fichier et y coller le code : | ||
| <file python spirale.py> | <file python spirale.py> | ||
| Ligne 43: | Ligne 43: | ||
| savefig('logarithmic_spiral.jpg') | savefig('logarithmic_spiral.jpg') | ||
| show()</file> | show()</file> | ||
| - | \\ | + | |
| Sauvegarder et rendre le fichier exécutable.\\ | Sauvegarder et rendre le fichier exécutable.\\ | ||
| Lancer le code, par exemple en ligne de commande :<code> python spirale.py</code> | Lancer le code, par exemple en ligne de commande :<code> python spirale.py</code> | ||
| Ligne 50: | Ligne 50: | ||
| {{ ::python:matplotlib:logarithmic_spiral.jpg ?direct&200 |}} | {{ ::python:matplotlib:logarithmic_spiral.jpg ?direct&200 |}} | ||
| - | Autre exemple d'utilisation (tiré de [[http://commons.wikimedia.org/wiki/File:Complex_arcsin_abs_01_Pengo.svg?uselang=fr|Wikipédia]] (licence domaine public)) : | + | Autre exemple d'utilisation (tiré de [[https://commons.wikimedia.org/wiki/File:Complex_arcsin_abs_01_Pengo.svg?uselang=fr|Wikipédia]] (licence domaine public)) : | 
| Créer un fichier et y coller le code : | Créer un fichier et y coller le code : | ||
| <file python graphs.py> | <file python graphs.py> | ||
| Ligne 79: | Ligne 79: | ||
| plt.savefig("complex_arcsin_" + gr + "_01_Pengo.jpg") | plt.savefig("complex_arcsin_" + gr + "_01_Pengo.jpg") | ||
| </file> | </file> | ||
| - | \\ | + | |
| Sauvegarder et rendre le fichier exécutable. | Sauvegarder et rendre le fichier exécutable. | ||
| Lancer le code, vous obtiendrez les figures suivantes : | Lancer le code, vous obtiendrez les figures suivantes : | ||
| - | \\ | + | |
| {{::python:matplotlib:complex_arcsin_abs_01_Pengo.jpg ?direct&200 |}} | {{::python:matplotlib:complex_arcsin_abs_01_Pengo.jpg ?direct&200 |}} | ||
| {{ ::python:matplotlib:complex_arcsin_angle_01_Pengo.jpg?direct&200 |}} | {{ ::python:matplotlib:complex_arcsin_angle_01_Pengo.jpg?direct&200 |}} | ||
| Ligne 90: | Ligne 90: | ||
| ===== Voir aussi ===== | ===== Voir aussi ===== | ||
| - | * [[http://matplotlib.org/|site officiel matplotlib]] | + | * [[https://matplotlib.org/|site officiel matplotlib]] | 
| * [[Gnuplot]] | * [[Gnuplot]] | ||
| * [[http://pyqtgraph.org/|PyQtGraph]] | * [[http://pyqtgraph.org/|PyQtGraph]] | ||