-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChart.py
More file actions
44 lines (29 loc) · 1.43 KB
/
Copy pathChart.py
File metadata and controls
44 lines (29 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#--------------------------------------------------------------------------------------
#
# $Source: TestFlakiness/Chart.py $
#
# $Copyright: (c) 2018 Bentley Systems, Incorporated. All rights reserved. $
#
#--------------------------------------------------------------------------------------
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
#-------------------------------------------------------------------------------------------
# bsimethod Firzok.Nadeem 20/07/2018
#-------------------------------------------------------------------------------------------
#---Entry point of the Script ---#
if __name__ == '__main__':
df=pd.read_csv("NewlyAddedTestsReport.csv")
X = np.array(df.Component.unique())
Y = np.unique(df.Component, return_counts=True)[1]
size = len(df.Component.unique())
plt.figure(figsize=(size+3,size+3))
sns.set_style("whitegrid")
groupedvalues=df.groupby('Component').sum().reset_index()
g = sns.barplot(x=X, y=Y, palette=sns.color_palette("cubehelix", len(df.Component.unique()) + 5))
for index, row in groupedvalues.iterrows():
g.text(row.name, Y[index] + 0.5, Y[index], color='black', ha="center", weight="bold")
sns.despine(left=True)
plt.savefig("test", dpi = 300)