feat: Use German locale for number formatting
This commit is contained in:
parent
78d4a48643
commit
25aa59c0eb
1 changed files with 7 additions and 3 deletions
10
plot.py
10
plot.py
|
@ -8,6 +8,10 @@ import pandas as pd
|
|||
import datetime
|
||||
import re
|
||||
import requests as req
|
||||
import locale
|
||||
|
||||
|
||||
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
|
||||
|
||||
sources_folder = 'Quellen'
|
||||
plots_folder = 'Plots'
|
||||
|
@ -83,9 +87,9 @@ def plot_extrapolation_portion(percentage):
|
|||
print_percentage = int(percentage * 100)
|
||||
|
||||
plt.title(
|
||||
'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis {} % der Bevölkerung Deutschlands\n'
|
||||
'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis {:n} % der Bevölkerung Deutschlands\n'
|
||||
'Erstellung: {}, Datenquelle: RKI, Stand: {}\n'
|
||||
'Impfungen gesamt: {} ({} %), Durchschnittliche Impfrate: {} Impfungen/Tag'.format(
|
||||
'Impfungen gesamt: {:n} ({:n} %), Durchschnittliche Impfrate: {:n} Impfungen/Tag'.format(
|
||||
print_percentage,
|
||||
print_today, print_stand,
|
||||
total_vaccinations, np.round(total_vaccinations_percentage * 100, 2), mean_vaccinations_daily_int
|
||||
|
@ -100,7 +104,7 @@ def plot_extrapolation_portion(percentage):
|
|||
ax2.set_xlim(xmax=dates[0] + datetime.timedelta(days=percentage * days_extrapolated))
|
||||
ax2.grid(True)
|
||||
ax2.plot(dates, cumulative, color='red', label='Kumulierte Impfungen')
|
||||
ax2.plot(extrapolated_dates, extrapolated_vaccinations, color='orange', label='Extrap. kumulierte Impfungen\n({} Impfungen/Tag)'.format(mean_vaccinations_daily_int))
|
||||
ax2.plot(extrapolated_dates, extrapolated_vaccinations, color='orange', label='Extrap. kumulierte Impfungen\n({:n} Impfungen/Tag)'.format(mean_vaccinations_daily_int))
|
||||
#ax2.plot()
|
||||
|
||||
ax.legend(loc='upper left')
|
||||
|
|
Loading…
Reference in a new issue