teaching:progappchim:matplotlib_simple

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

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/01/02 22:38] – [Références] villersdteaching:progappchim:matplotlib_simple [2018/04/27 08:38] – [Références] villersd
Ligne 23: Ligne 23:
   * standard : <code>import matplotlib as mpl   * standard : <code>import matplotlib as mpl
 import matplotlib.pyplot as plt</code> import matplotlib.pyplot as plt</code>
-  * alternative, simplifiée (en mode pylab) : <code>from pylab import *</code>+  * alternative, simplifiée (en mode pylab, pour obtenir une certaine compatibilité avec Matlab) : <code>from pylab import *</code>
  
 ===== Graphiques de séries de points en lignes ===== ===== Graphiques de séries de points en lignes =====
Ligne 159: Ligne 159:
 | {{: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)| un autre... | un autre... |
 | un autre... | un autre... | un autre... | | un autre... | un autre... | un autre... |
 +
 +===== Utilisation "inline" ou en fenêtre interactive, sous Spyder =====
 +Notamment avec l'éditeur Spyder, il est possible de choisir le mode d'affichage des graphes :
 +  * dans une fenêtre interactive
 +  * en ligne (mode "inline") sous forme d'une image au format .png, dans la console
 +Pour choisir le mode, utiliser les réglages suivants de Spyder : menu Outils - option Préférences - rubrique Console Ipython - onglet Graphiques - la sortie "Automatique" permet d'obtenir les graphes dans une fenêtre interactive, sinon, choisir "En ligne". L'option sera prise en compte après avoir quitté Spyder et l'avoir relancé. Sinon, il est possible de sélectionner l'un ou l'autre des modes par les commandes suivantes dans la console :
 +<code>
 +%matplotlib auto
 +%matplotlib inline
 +</code>
  
 ===== Références ===== ===== Références =====
Ligne 170: Ligne 180:
   * [[http://python.developpez.com/tutoriels/graphique-2d/matplotlib/|Tutoriel en français]]   * [[http://python.developpez.com/tutoriels/graphique-2d/matplotlib/|Tutoriel en français]]
   * [[http://www.science-emergence.com/Matplotlib/|Un autre tutoriel en français]]   * [[http://www.science-emergence.com/Matplotlib/|Un autre tutoriel en français]]
 +  * [[http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb|matplotlib - 2D and 3D plotting in Python]], tutoriel Jupyter en anglais
   * [[https://github.com/thehackerwithin/PyTrieste/wiki/Python7-MatPlotLib|Un tutoriel en anglais]]   * [[https://github.com/thehackerwithin/PyTrieste/wiki/Python7-MatPlotLib|Un tutoriel en anglais]]
   * [[http://scipy-lectures.github.io/intro/matplotlib/matplotlib.html|Matplotlib: plotting]], par Nicolas Rougier, Mike Müller, Gaël Varoquaux (et la [[http://www.labri.fr/perso/nrougier/teaching/matplotlib/|version dérivée]] de Nicolas Rougier)   * [[http://scipy-lectures.github.io/intro/matplotlib/matplotlib.html|Matplotlib: plotting]], par Nicolas Rougier, Mike Müller, Gaël Varoquaux (et la [[http://www.labri.fr/perso/nrougier/teaching/matplotlib/|version dérivée]] de Nicolas Rougier)
 +  * [[https://realpython.com/python-matplotlib-guide/|Python Plotting With Matplotlib (Guide)]], 2018
   * [[http://www.thetechrepo.com/main-articles/465-how-to-create-a-graph-in-python.html]]   * [[http://www.thetechrepo.com/main-articles/465-how-to-create-a-graph-in-python.html]]
   * Un article intéressant sur les recommandations pour de bonnes figures : [[http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1003833|Ten Simple Rules for Better Figures]], Nicolas P. Rougier (INRIA, France). Les figures sont crées avec matplotlib et l'ensemble de l'article est disponible sous licence CC0.   * Un article intéressant sur les recommandations pour de bonnes figures : [[http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1003833|Ten Simple Rules for Better Figures]], Nicolas P. Rougier (INRIA, France). Les figures sont crées avec matplotlib et l'ensemble de l'article est disponible sous licence CC0.
Ligne 179: Ligne 191:
   * [[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://waterprogramming.wordpress.com/2016/04/29/interactive-plotting-basics-in-matplotlib/|Interactive plotting basics in matplotlib]]
  
 +==== Exemples ==== 
 +  * [[https://towardsdatascience.com/5-quick-and-easy-data-visualizations-in-python-with-code-a2284bae952f|5 Quick and Easy Data Visualizations in Python with Code]] 
 +  * Jupyter notebooks :  
 +    * [[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]]
  • teaching/progappchim/matplotlib_simple.txt
  • Dernière modification : 2023/07/11 07:46
  • de villersd