diff --git a/module2/exo2/exercice_python_fr.org b/module2/exo2/exercice_python_fr.org index 6cbf3c9b44683b1c7ad4a54e1d1191d74b6b536b..6aa9419b0edc212a069f56f91297ad10aeeddb5a 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]]