Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes |
teaching:progappchim:matplotlib_simple [2019/04/26 13:40] – villersd | teaching:progappchim:matplotlib_simple [2020/07/19 22:39] – [Références] villersd |
---|
Le projet [[http://wiki.scipy.org/PyLab|Pylab]] vise à regrouper ces différentes librairies. De nombreuses commandes de Pylab ont été définies semblablement aux commandes du logiciel commercial [[http://fr.wikipedia.org/wiki/MATLAB|MatLab]]. | Le projet [[http://wiki.scipy.org/PyLab|Pylab]] vise à regrouper ces différentes librairies. De nombreuses commandes de Pylab ont été définies semblablement aux commandes du logiciel commercial [[http://fr.wikipedia.org/wiki/MATLAB|MatLab]]. |
| |
| TODO : différences pyplot comme ici : https://towardsdatascience.com/5-quick-facts-about-python-matplotlib-53f23eab6d31 |
| |
===== Installation ===== | ===== Installation ===== |
| |
La [[http://matplotlib.sourceforge.net/users/installing.html|page d'installation de Matplotlib]] fournit une procédure pas à pas assez complète et facile pour installer matplotlib (et NumPy). Sinon : | La [[http://matplotlib.sourceforge.net/users/installing.html|page d'installation de Matplotlib]] fournit une procédure pas à pas assez complète et facile pour installer matplotlib (et NumPy). Sinon : |
* Sous Windows, installez une distribution complète comme [[http://code.google.com/p/pythonxy/|Python (x, y)]] | * Sous Windows, installez une distribution complète comme [[https://www.anaconda.com/distribution/|Anaconda]] ou [[http://code.google.com/p/pythonxy/|Python (x, y)]] |
* Sous Linux, installez les librairies suivantes : python-numpy python-scipy python-matplotlib | * Sous GNU/Linux, on peut aussi n'installer que les librairies suivantes : python-numpy python-scipy python-matplotlib |
| |
===== Directive d'importation ==== | ===== Directive d'importation ==== |
À [[plot_sinus_cosinus|cette page]], on montre en détail comment réaliser une représentation graphique simple des fonctions sinus et cosinus. Au départ le graphique utilisera les réglages par défaut et la figure sera ensuite améliorée pas à pas en commentant les instructions matplotlib utilisées. | À [[plot_sinus_cosinus|cette page]], on montre en détail comment réaliser une représentation graphique simple des fonctions sinus et cosinus. Au départ le graphique utilisera les réglages par défaut et la figure sera ensuite améliorée pas à pas en commentant les instructions matplotlib utilisées. |
| |
Source : [[http://scipy-lectures.github.io/intro/matplotlib/matplotlib.html|Matplotlib: plotting]], par Nicolas Rougier, Mike Müller, Gaël Varoquaux. | Source : [[http://gael-varoquaux.info/scipy-lecture-notes/intro/matplotlib/index.html|Matplotlib: plotting]], par Nicolas Rougier, Mike Müller, Gaël Varoquaux. |
| |
<note tip>Cette dernière référence reprend aussi des explications sur les principes d'organisation des graphiques multiples sur une figure, propose d'autres types de graphes sous forme d'exercices avec les solutions disponibles, et propose de nombreux liens pour l'apprentissage de Matplotlib.</note> | <note tip>Cette dernière référence reprend aussi des explications sur les principes d'organisation des graphiques multiples sur une figure, propose d'autres types de graphes sous forme d'exercices avec les solutions disponibles, et propose de nombreux liens pour l'apprentissage de Matplotlib.</note> |
===== Galerie d'exemples ===== | ===== Galerie d'exemples ===== |
| {{:teaching:progappchim:histogramme_simple.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:Histogramme_simple|Histogramme simple]] | {{:teaching:progappchim:rotateur_biatomique-01.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:rotateur_biatomique|Rotateur biatomique]] | {{:teaching:progappchim:potentiel_morse-04.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:potentiel_morse|Potentiel de Morse]]| | | {{:teaching:progappchim:histogramme_simple.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:Histogramme_simple|Histogramme simple]] | {{:teaching:progappchim:rotateur_biatomique-01.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:rotateur_biatomique|Rotateur biatomique]] | {{:teaching:progappchim:potentiel_morse-04.png?280|}} \\ [[teaching:progappchim:matplotlib_gallery:potentiel_morse|Potentiel de Morse]]| |
| {{:teaching:progappchim:ph_topographic-01.png?280|}} \\ [[teaching:progappchim:ph-3d|Ph à 3D]] \\ (dilution et neutralisation)| un autre... | un autre... | | | {{:teaching:progappchim:ph_topographic-01.png?280|}} \\ [[teaching:progappchim:ph-3d|Ph à 3D]] \\ (dilution et neutralisation)| {{:teaching:progappchim:matplotlib_gallery:pka-pkb-plane-01.png?280}} \\ [[:teaching:progappchim:matplotlib_gallery:pka_pkb_plane|Couples acide-base dans le plan pKa/pKb]] | un autre... | |
| un autre... | un autre... | un autre... | | | un autre... | un autre... | un autre... | |
| |
* [[https://towardsdatascience.com/animations-with-matplotlib-d96375c5442c|Animations with Matplotlib]] FIXME | * [[https://towardsdatascience.com/animations-with-matplotlib-d96375c5442c|Animations with Matplotlib]] FIXME |
* [[https://matplotlib.org/gallery/animation/rain.html]] | * [[https://matplotlib.org/gallery/animation/rain.html]] |
| |
| ===== Styles ===== |
| * [[https://dvillers.umons.ac.be/wiki/teaching:progappchim:matplotlib_simple#references|teaching:progappchim:matplotlib_simple [Didier Villers, UMONS - wiki]]] |
| * [[https://tonysyu.github.io/matplotlib-style-gallery.html#.XtmoqDDgpqs|Matplotlib Style Gallery - Tony S. Yu]] |
| * [[https://matplotlib.org/3.2.1/tutorials/introductory/customizing.html|Customizing Matplotlib with style sheets and rcParams — Matplotlib 3.2.1 documentation]] |
| * [[https://jakevdp.github.io/PythonDataScienceHandbook/04.11-settings-and-stylesheets.html|Customizing Matplotlib: Configurations and Stylesheets | Python Data Science Handbook]] |
| * [[https://matplotlib.org/3.2.1/gallery/style_sheets/style_sheets_reference.html|Style sheets reference — Matplotlib 3.2.1 documentation]] |
| * [[https://github.com/dhaitz/mplcyberpunk|dhaitz/mplcyberpunk: “Cyberpunk style” for matplotlib plots]] |
| |
| |
===== Références ===== | ===== Références ===== |
* [[https://towardsdatascience.com/all-your-matplotlib-questions-answered-420dd95cb4ff|Your Ultimate Guide to Matplotlib]] (not so ultimate...) | * [[https://towardsdatascience.com/all-your-matplotlib-questions-answered-420dd95cb4ff|Your Ultimate Guide to Matplotlib]] (not so ultimate...) |
* [[https://towardsdatascience.com/a-step-by-step-guide-for-creating-advanced-python-data-visualizations-with-seaborn-matplotlib-1579d6a1a7d0|A step-by-step guide for creating advanced Python data visualizations with Seaborn / Matplotlib]] | * [[https://towardsdatascience.com/a-step-by-step-guide-for-creating-advanced-python-data-visualizations-with-seaborn-matplotlib-1579d6a1a7d0|A step-by-step guide for creating advanced Python data visualizations with Seaborn / Matplotlib]] |
| * [[https://medium.com/dunder-data/create-a-bar-chart-race-animation-in-python-with-matplotlib-477ed1590096|Creating a Bar Chart Race Animation in Python with Matplotlib]] |
| * [[https://medium.com/python-in-plain-english/radar-chart-basics-with-pythons-matplotlib-ba9e002ddbcd|Radar Chart Basics with Python’s Matplotlib]] |
| * [[https://towardsdatascience.com/matplotlib-who-said-it-needs-to-be-simple-7156df7c827b|Matplotlib — Who said it needs to be simple? - by Renan Lolico - Jun, 2020 - Towards Data Science]] |
| |
| |
| |
==== Exemples ==== | ==== Exemples ==== |
* [[http://nbviewer.jupyter.org/github/jming/cs109/blob/master/lec_03_statistical_graphs.ipynb|A Gallery of Statistical Graphs in Matplotlib]] | * [[http://nbviewer.jupyter.org/github/jming/cs109/blob/master/lec_03_statistical_graphs.ipynb|A Gallery of Statistical Graphs in Matplotlib]] |
* [[http://nbviewer.jupyter.org/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb|XKCD plots in Matplotlib]] + [[http://nbviewer.jupyter.org/url/jakevdp.github.io/downloads/notebooks/XKCD_sketch_path.ipynb|ceci]] | * [[http://nbviewer.jupyter.org/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb|XKCD plots in Matplotlib]] + [[http://nbviewer.jupyter.org/url/jakevdp.github.io/downloads/notebooks/XKCD_sketch_path.ipynb|ceci]] |
| * [[https://github.com/naveenv92/python-science-tutorial|Python Science Tutorials]] Naveen Venkatesan, contains a series of scripts and notebooks to help people get acclimated to using Python for scientific publications. |