From 99e213b179a4c112bdc550512b902a5e61e4f766 Mon Sep 17 00:00:00 2001 From: escuiller Date: Fri, 24 Apr 2020 14:58:49 +0200 Subject: [PATCH] partie 2 exo 2 fichier org --- module2/exo2/exercice_python_fr.org | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/module2/exo2/exercice_python_fr.org b/module2/exo2/exercice_python_fr.org index 6cbf3c9..6aa9419 100644 --- a/module2/exo2/exercice_python_fr.org +++ b/module2/exo2/exercice_python_fr.org @@ -142,3 +142,41 @@ round(np.std(données, ddof=1), 2) #+RESULTS: : 4.33 + +** Graphiques +**** Séquence +#+begin_src python :results file :session :exports source +import matplotlib.pyplot as plt + +plt.figure(figsize=(5,5)) +plt.plot(données) +plt.tight_layout() + +plt.savefig("sequence.png") +#+end_src + +#+RESULTS: +[[file:[]]] +[[file:[]]] +[[file:[]]] +[[file:[]]] + + +[[sequence.png]] + +**** Histogramme +#+begin_src python :results file :session :exports both + +plt.figure(figsize=(10,5)) +plt.hist(données) +plt.tight_layout() + +plt.savefig("histogramme.png") +#+end_src + +#+RESULTS: +[[file:(array([ 4., 3., 5., 9., 16., 20., 22., 9., 8., 4.]), array([ 2.8 , 4.86, 6.92, 8.98, 11.04, 13.1 , 15.16, 17.22, 19.28, + 21.34, 23.4 ]), )]] + + +[[histogramme.png]] -- 2.18.1