X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=06-tour-shapes%2Ftour-shape-plots.py;h=4bb47e0b47aa45fbe064c7c7784dd224fb39eb5c;hb=47822cddf29c002717701d786b6f41ac02a73da0;hp=af9e3564113f635008007f6f67177f8a8847f0af;hpb=d91c9d64d82c20a1ee9feea1c2e403f5f013a7f3;p=ou-summer-of-code-2017.git diff --git a/06-tour-shapes/tour-shape-plots.py b/06-tour-shapes/tour-shape-plots.py index af9e356..4bb47e0 100644 --- a/06-tour-shapes/tour-shape-plots.py +++ b/06-tour-shapes/tour-shape-plots.py @@ -507,10 +507,11 @@ def heart_tour_func(): return heart_tour # meta.add_text('Description', tour) # im.save(filename, 'PNG', pnginfo=meta) -with open('tours-random-walk.txt') as f: +# with open('tours-random-walk.txt') as f: +with open('samples.txt') as f: for i, tour_s in enumerate(f.readlines()): tour = tour_s.strip() - filename = 'tour-{:03}-s{:04}-m{:03}-walk.png'.format(i, len(tour), len(mistake_positions(trace_tour(tour)))) + filename = 'sample-tour-{:03}-s{:04}-m{:03}-walk.png'.format(i, len(tour), len(mistake_positions(trace_tour(tour)))) plot_trace(trace_tour(tour), filename=filename) im = Image.open(filename) meta = PngImagePlugin.PngInfo()