def plotTimeMultiHistogram(parseTimes, hashTimes, compileTimes, filename): # times in ms
bins = np.linspace(0, 5000, 50)
data = np.vstack([parseTimes, hashTimes, compileTimes]).T
fig, ax = plt.subplots()
plt.hist(data, bins, alpha=0.7, label=['parsing', 'hashing', 'compiling'], color=[parseColor, hashColor, compileColor])
plt.legend(loc='upper right')
plt.xlabel('time [ms]')
plt.ylabel('#files')
fig.savefig(filename)
fig, ax = plt.subplots()
boxplot_data = [[i/1000 for i in parseTimes], [i/1000 for i in hashTimes], [i/1000 for i in compileTimes]] # times to s
plt.boxplot(boxplot_data, 0, 'rs', 0, [5, 95])
plt.xlabel('time [s]')
plt.yticks([1, 2, 3], ['parsing', 'hashing', 'compiling'])
#lgd = ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) # legend on the right
fig.savefig(filename[:-4] + '_boxplots' + GRAPH_EXTENSION)
评论列表
文章目录