diff --git a/ovito_overlay.py b/ovito_overlay.py index b725ba9956340b0d8b869cec1c6605df99c3c292..3570e2a0d4ff5c5c964e2a5cebab2ddc053b2cee 100644 --- a/ovito_overlay.py +++ b/ovito_overlay.py @@ -18,6 +18,7 @@ # ------------------------------ import ovito + # This user-defined function is called by OVITO to let it draw arbitrary graphics on top of the viewport. # It is passed a QPainter (see http://qt-project.org/doc/qt-5/qpainter.html). def render(painter, **args): diff --git a/vis.py b/vis.py index ced73291dd4f3ff4321916aced809221b3430a99..ad93e34909bae075e99cb2f4fc9379e3f6a90c98 100644 --- a/vis.py +++ b/vis.py @@ -89,8 +89,12 @@ def draw_figures(z_positions, dict_concs_mean, energy_list, frame_list, fig_rang plt.ylim(-1, 101) plt.grid() plt.legend() - plt.title('Average concentrations from frame {start} to {end}'.format(start=profile_mean_range[0], - end=profile_mean_range[-1])) + if profile_mean_range[0] == profile_mean_range[-1]: + title_str = 'Concentrations at frame {frame}'.format(frame=profile_mean_range[0]) + else: + title_str = 'Average concentrations from frame {start} to {end}'.format(start=profile_mean_range[0], + end=profile_mean_range[-1]) + plt.title(title_str) figure_mean.savefig(os.path.join(out_path, 'profile_mean.pdf')) data_matrix = np.transpose(np.matrix(data_matrix)) np.savetxt(os.path.join(out_path, "profile_mean.txt"), data_matrix, header=' '.join(data_header), fmt='%.6f') @@ -103,8 +107,12 @@ def draw_figures(z_positions, dict_concs_mean, energy_list, frame_list, fig_rang plt.ylim(-1, 101) plt.grid() plt.legend() - plt.title('Average concentrations from frame {start} to {end}'.format(start=profile_mean_range[0], - end=profile_mean_range[-1])) + if profile_mean_range[0] == profile_mean_range[-1]: + title_str = 'Filtered concentrations at frame {frame}'.format(frame=profile_mean_range[0]) + else: + title_str = 'Filtered average concentrations from frame {start} to {end}'.format(start=profile_mean_range[0], + end=profile_mean_range[-1]) + plt.title(title_str) figure_mean_filtered.savefig(os.path.join(out_path, 'profile_mean_filtered.pdf')) # ------------------------------ @@ -147,8 +155,11 @@ def draw_figures(z_positions, dict_concs_mean, energy_list, frame_list, fig_rang def update(frame_number): plt.figure(figure_anim.number) atom_dict_concs = frame_list[frame_number] - - plt.title('Concentrations at frame {frame}'.format(frame=frame_number)) + if average_filter: + title_str = 'Filtered concentrations at frame {frame}'.format(frame=frame_number) + else: + title_str = 'Concentrations at frame {frame}'.format(frame=frame_number) + plt.title(title_str) for symbol, line in lines: data = atom_dict_concs[symbol] if average_filter: @@ -433,5 +444,6 @@ if __name__ == '__main__': arguments.average_filter, multi_path) + # TODO: write average lattice creation, simulation time multi_report_file.close() print("OK")