def graphRampTime(deltas, nocontribs, graphtitle, xtitle, filename):
data = [Histogram(x=deltas)]
layout = Layout(
title=graphtitle,
yaxis=dict(title='Number of contributors'),
xaxis=dict(title= xtitle +
'<br>Mean: ' + '{:.2f}'.format(statistics.mean(deltas)) + ' days, ' +
'Median: ' + '{:.2f}'.format(statistics.median(deltas)) + ' days' +
'<br>Number of contributors who did this: ' +
'{:,g}'.format(len(deltas)) +
'<br>Percentage of contributors who did this: ' +
'{:.2f}'.format(len(deltas)/(len(deltas)+len(nocontribs))*100) + '%')
)
fig = Figure(data=data, layout=layout)
return offline.plot(fig, show_link=False, include_plotlyjs=False, output_type='div')
# FIXME Maybe look for the word 'bot' in the user description?
评论列表
文章目录