def calc_staff(i): file_name = files[i] print "Plot file (" + "{0:.2f}".format(i / totalFiles * 100) + "%) " + str(file_name) groups = re.search('(.*)a(.*).dat', file_name) file_data = TecData(file_name) figure, ax = plt.subplots() file_data.plot_contour(ax) file_data.plot_roche_lobe(ax) file_data.plot_velocity_filed(ax) figure.suptitle('T=7500, time = ' + "{:.2}".format(file_data['time'])) # plt.savefig(target + "contour_" + groups.group(2) + '.png') plt.show() plt.close(figure)