diff --git a/plot.py b/plot.py index f6fc728..2648758 100644 --- a/plot.py +++ b/plot.py @@ -82,8 +82,8 @@ filename_stand = stand_date.strftime("%Y%m%d%H%M%S") def plot_extrapolation_portion(percentage): print_percentage = int(percentage * 100) - plot_filename = '{}/{}_extrapolated_to_{}_percent.pdf'.format(plots_folder, filename_stand, print_percentage) - plot_filename_latest = '{}/latest_extrapolated_to_{}_percent.pdf'.format(plots_folder, print_percentage) + plot_filename = '{}/{}_extrapolated_to_{}_percent'.format(plots_folder, filename_stand, print_percentage) + plot_filename_latest = '{}/latest_extrapolated_to_{}_percent'.format(plots_folder, print_percentage) if os.path.isfile(plot_filename): print('Plot {} already exists'.format(plot_filename)) @@ -128,11 +128,13 @@ def plot_extrapolation_portion(percentage): ax2.set_ylabel('Kumulierte Impfungen') - plt.savefig(plot_filename) - plt.savefig(plot_filename_latest) + plt.savefig(plot_filename + '.pdf') + plt.savefig(plot_filename + '.png') + plt.savefig(plot_filename_latest + '.pdf') + plt.savefig(plot_filename_latest + '.png') plt.close() - print('Created plot {}'.format(plot_filename)) + print('Created plot {} as pdf and png'.format(plot_filename)) plot_extrapolation_portion(0.1)