~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/plot-sizes.py

  • Committer: Michael Hope
  • Date: 2012-06-12 03:40:53 UTC
  • Revision ID: michael.hope@linaro.org-20120612034053-01y3rxf81q1g2r0f
Generate a tumbnail and full size for the size plots.  Tweak the colours to have more and make the first a Linaro purple.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
        else:
20
20
            return '%.1f k' % (v/1024)
21
21
 
22
 
def plot(records, function, alignment=None):
 
22
def plot(records, function, alignment=None, scale=1):
23
23
    variants = libplot.unique(records, 'variant', prefer='this')
24
24
    records = [x for x in records if x.function==function]
25
25
 
32
32
 
33
33
    bytes = libplot.unique(records, 'bytes')[0]
34
34
 
35
 
    colours = iter('bgrcmyk')
 
35
    colours = libplot.make_colours()
36
36
    all_x = []
37
37
 
38
 
    pylab.figure(1).set_size_inches((16, 12))
 
38
    pylab.figure(1).set_size_inches((6.4*scale, 4.8*scale))
39
39
    pylab.clf()
40
40
 
41
41
    if 'str' in function:
59
59
            pylab.plot(X, Y, c=colour)
60
60
            pylab.scatter(X, Y, c=colour, label=variant, edgecolors='none')
61
61
 
62
 
    pylab.legend(loc='upper left', ncol=3)
 
62
    pylab.legend(loc='upper left', ncol=3, prop={'size': 'small'})
63
63
    pylab.grid()
64
64
    pylab.title('%(function)s of %(aalignment)s byte aligned blocks' % locals())
65
65
    pylab.xlabel('Size (B)')
85
85
 
86
86
    for function in functions:
87
87
        for alignment in alignments:
88
 
            plot(records, function, alignment)
89
 
            pylab.savefig('sizes-%s-%02d.png' % (function, alignment), dpi=72)
 
88
            for scale in [1, 2.5]:
 
89
                plot(records, function, alignment, scale)
 
90
                pylab.savefig('sizes-%s-%02d-%.1f.png' % (function, alignment, scale), dpi=72)
90
91
 
91
92
    pylab.show()
92
93
 
93
94
if __name__ == '__main__':
94
95
    main()
95