import pandas as pd import seaborn as sns import matplotlib.pyplot as plt if __name__ == '__main__': data = pd.read_csv('commit.csv') data['type'] = data['is_ml'].apply(lambda x: 'ML' if x else 'No ML') g = sns.catplot(x="type", kind="count", data=data)\ .set(title='Istanze dei commit in base al tipo')\ .set(xlabel='tipo') ax = g.facet_axis(0, 0) for p in ax.patches: ax.text( p.get_x() + p.get_width() * 0.39, p.get_height() + 10, p.get_height(), color='black', rotation='horizontal', size='large') plt.tight_layout() #plt.show() plt.savefig('../src/figures/count-commit.pdf')