summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-07-19 17:26:40 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-07-19 17:26:40 +0100
commit8b433b7bd23b8d7d0f75ad4e2345ada4953e066e (patch)
tree8f5858a013db7638bb845fa4a4cb77a94301dcbf
parent74f1aa7cf7f0a647cf1f8993a032a7a1d46828f2 (diff)
Number of changes to make the graph look better
* Improve legend position * Add current coverage in percent to legend * Line style now with data points * Two lines indicate poor (red) and good (green) coverage Signed-off-by: Daniel Willmann <daniel@totalueberwachung.de>
-rwxr-xr-xgraph-coverage.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/graph-coverage.py b/graph-coverage.py
index e61d6d5..e2a3179 100755
--- a/graph-coverage.py
+++ b/graph-coverage.py
@@ -160,10 +160,10 @@ if options.graph:
160 fn_per.append(float(result[2])/result[1]*100) 160 fn_per.append(float(result[2])/result[1]*100)
161 ln_per.append(float(result[4])/result[3]*100) 161 ln_per.append(float(result[4])/result[3]*100)
162 162
163 fncov = plot(numpy.arange(len(dates)), fn_per, linewidth=1.0) 163 fncov = plot(numpy.arange(len(dates)), fn_per, 'o-', linewidth=1.0)
164 lncov = plot(numpy.arange(len(dates)), ln_per, linewidth=1.0) 164 lncov = plot(numpy.arange(len(dates)), ln_per, 'o-',linewidth=1.0)
165 165
166 legend((fncov[0], lncov[0]), ('Functions', 'Lines')) 166 legend((fncov[0], lncov[0]), ('Functions %0.2f%%'%(fn_per[-1]), 'Lines %0.2f%%'%(ln_per[-1])), loc=3)
167 ind = numpy.arange(len(dates)) 167 ind = numpy.arange(len(dates))
168 lims = xlim() 168 lims = xlim()
169 xlim((lims[0]-0.5, lims[1]+0.5)) 169 xlim((lims[0]-0.5, lims[1]+0.5))
@@ -173,6 +173,11 @@ if options.graph:
173 ylim((0,100)) 173 ylim((0,100))
174 ylabel('coverage in %') 174 ylabel('coverage in %')
175 title(options.label) 175 title(options.label)
176 axhline(80, color='green', lw=2, alpha=0.5)
177 axhline(40, color='red', lw=2, alpha=0.5)
178# fill_between(xlim(), 0, 30, facecolor='red', alpha=0.3)
179# fill_between(xlim(), 80, 100, facecolor='green', alpha=0.3)
180
176 181
177 savefig(options.graph, transparent=False) 182 savefig(options.graph, transparent=False)
178 close() 183 close()