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 [2018/03/31 16:46] – villersd | teaching:progappchim:matplotlib_simple [2020/06/05 04:09] – 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... | |
| |
%matplotlib inline | %matplotlib inline |
</code> | </code> |
| |
| ===== Animations ===== |
| * [[https://towardsdatascience.com/animations-with-matplotlib-d96375c5442c|Animations with Matplotlib]] FIXME |
| * [[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://seaborn.pydata.org/|Seaborn]], une librairie basée sur Matplotlib | * [[https://seaborn.pydata.org/|Seaborn]], une librairie basée sur Matplotlib |
* [[https://python-graph-gallery.com/|the Python Graph Gallery]], galerie de graphes Seaborn/Matplotlib avec code | * [[https://python-graph-gallery.com/|the Python Graph Gallery]], galerie de graphes Seaborn/Matplotlib avec code |
| * [[https://medium.com/@neuralnets/statistical-data-visualization-series-with-python-and-seaborn-for-data-science-5a73b128851d|Data Visualization with Python and Seaborn]] |
| * [[https://waterprogramming.wordpress.com/2016/04/29/interactive-plotting-basics-in-matplotlib/|Interactive plotting basics in matplotlib]] |
| * [[https://heartbeat.fritz.ai/introduction-to-matplotlib-data-visualization-in-python-d9143287ae39|Introduction to Matplotlib — Data Visualization in Python]] |
| * [[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://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]] |
| |
==== Exemples ==== | ==== Exemples ==== |