Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib
- matplotlib.use('Agg') # supprimez cette ligne si vous avez une interface graphique (bureau avec dossiers et fond d'écran ridicule..)
- import matplotlib.pyplot as plt
- import numpy as np
- import pandas as pd
- # angles faciaux
- af = {"Australo":[56, 75], "habilis":[65, 68], "erectus":[75,81], "néandertal":[71,89],"sapiens":[82,88], "chimpanzé":[34,45], "gorille":[34,47]}
- af = pd.DataFrame(af)
- plt.close()
- pb = af.boxplot(fontsize=7)
- plt.xlabel("Espèces", fontsize=8)
- plt.ylabel("Angle facial (degrés)", fontsize=8)
- plt.title("Angle facial", fontsize= 10)
- plt.axhline(y=78, hold=None, color="r", linestyle="--") # ligne horizontale correspondant au fossile STGM dont l'angle est de 78°
- 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),)
- plt.savefig("angle_facial.png")
- # rapport hauteur longueur
- 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]}
- hl = pd.DataFrame(hl)
- plt.close()
- pbb = hl.boxplot(fontsize=7)
- plt.xlabel("Espèces", fontsize=8)
- plt.ylabel("Rapport H/L", fontsize=8)
- plt.title("Hauteur / Longueur", fontsize= 10)
- plt.axhline(y=0.5, hold=None, color="r", linestyle="--") # ligne horizontale correspondant au fossile STGM de rapport h/l = 0.5
- 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),)
- plt.savefig("hauteurlongueur.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement