Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. import matplotlib
  2.  
  3. matplotlib.use('Agg') # supprimez cette ligne si vous avez une interface graphique (bureau avec dossiers et fond d'écran ridicule..)
  4.  
  5. import matplotlib.pyplot as plt
  6. import numpy as np
  7. import pandas as pd
  8.  
  9. # angles faciaux
  10. af = {"Australo":[56, 75], "habilis":[65, 68], "erectus":[75,81], "néandertal":[71,89],"sapiens":[82,88], "chimpanzé":[34,45], "gorille":[34,47]}
  11.  
  12. af = pd.DataFrame(af)
  13.  
  14. plt.close()
  15.  
  16. pb = af.boxplot(fontsize=7)
  17.  
  18. plt.xlabel("Espèces", fontsize=8)
  19. plt.ylabel("Angle facial (degrés)", fontsize=8)
  20. plt.title("Angle facial", fontsize= 10)
  21.  
  22. plt.axhline(y=78, hold=None, color="r", linestyle="--") # ligne horizontale correspondant au fossile STGM dont l'angle est de 78°
  23.  
  24. plt.annotate('Fossile STGM', xy=(1, 78), xytext=(1.3, 82), fontsize=8, arrowprops=dict(headwidth=4, headlength=2, width=0.4, facecolor='black', shrink=0.05),)
  25.  
  26. plt.savefig("angle_facial.png")
  27.  
  28.  
  29.  
  30. # rapport hauteur longueur
  31.  
  32. hl = {"Australo":[0.58,0.67], "habilis":[0.48,0.66], "erectus":[0.46,0.54], "néandertal":[0.45,0.63],"sapiens":[0.59,0.64], "chimpanzé":[0.4,0.47], "gorille":[0.38,0.46]}
  33.  
  34. hl = pd.DataFrame(hl)
  35.  
  36. plt.close()
  37.  
  38. pbb = hl.boxplot(fontsize=7)
  39.  
  40. plt.xlabel("Espèces", fontsize=8)
  41. plt.ylabel("Rapport H/L", fontsize=8)
  42. plt.title("Hauteur / Longueur", fontsize= 10)
  43.  
  44. plt.axhline(y=0.5, hold=None, color="r", linestyle="--") # ligne horizontale correspondant au fossile STGM de rapport h/l = 0.5
  45.  
  46. plt.annotate('Fossile STGM', xy=(5, 0.5), xytext=(5, 0.53), fontsize=8, arrowprops=dict(headwidth=4, headlength=2, width=0.4, facecolor='black', shrink=0.05),)
  47.  
  48. plt.savefig("hauteurlongueur.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement