From 5ff79a795df33a8ccac15ea3c5ce59a3f2970817 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 3 Oct 2013 06:38:10 +0200 Subject: [PATCH] Correctly plot cumulative sum. --- doc/tools/plot_pr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/tools/plot_pr.py b/doc/tools/plot_pr.py index 60f5de54..96860e7f 100644 --- a/doc/tools/plot_pr.py +++ b/doc/tools/plot_pr.py @@ -131,8 +131,11 @@ plt.legend(loc=2, title='Release') plt.subplots_adjust(top=0.875, bottom=0.225) import numpy as np +cumulative = np.cumsum(n) +cumulative += len(dates) - cumulative[-1] + ax2 = plt.twinx() -ax2.plot(bins[:-1], np.cumsum(n), 'black', linewidth=2) +ax2.plot(bins[:-1], cumulative, 'black', linewidth=2) ax2.set_ylabel('Total PRs') plt.savefig('PRs.png')