feat: New plot comparing both vaccinations with six weeks interval
This commit is contained in:
		
							parent
							
								
									2289168af1
								
							
						
					
					
						commit
						4c81daa025
					
				
					 1 changed files with 50 additions and 8 deletions
				
			
		
							
								
								
									
										58
									
								
								plot.py
									
										
									
									
									
								
							
							
						
						
									
										58
									
								
								plot.py
									
										
									
									
									
								
							| 
						 | 
					@ -505,6 +505,44 @@ def plot_vaccination_bar_graph_compare_both_vaccinations():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plot_vaccination_bar_graph_compare_both_vaccinations()
 | 
					plot_vaccination_bar_graph_compare_both_vaccinations()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def plot_vaccination_bar_graph_compare_both_vaccinations_six_weeks():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						plot_name = 'vaccination_bar_graph_compare_both_vaccinations_six_weeks'
 | 
				
			||||||
 | 
						if not check_recreate_plot(plot_name):
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						fig, ax = plt.subplots(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						plt.title(
 | 
				
			||||||
 | 
							'Tägliche Impfrate (Erst- und Zweitimpfung um 42 Tage versetzt)\n'
 | 
				
			||||||
 | 
								'Datenquelle: RKI, Stand: {}. Erstellung: {}, Ersteller: Benedikt Bastin, Lizenz: CC BY-SA 4.0\n'.format(
 | 
				
			||||||
 | 
								print_stand, print_today
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ax.grid()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						date_numbers_first = date2num(dates + datetime.timedelta(days=42))
 | 
				
			||||||
 | 
						date_numbers_second = date2num(dates)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ax.bar(date_numbers_first - 0.2, data_first_vaccination['daily'], width=0.4, label='Tägliche Erstimpfungen', color='blue')
 | 
				
			||||||
 | 
						ax.bar(date_numbers_second + 0.2, data_second_vaccination['daily'], width=0.4, label='Tägliche Zweitimpfungen', color='lightblue')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ax.set_ylim([0, np.max([np.max(data_first_vaccination['daily']), np.max(data_second_vaccination['daily'])])])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ax.legend(loc='upper left')
 | 
				
			||||||
 | 
						ax.xaxis_date()
 | 
				
			||||||
 | 
						ax.get_yaxis().get_major_formatter().set_scientific(False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ax.set_xlabel('Datum')
 | 
				
			||||||
 | 
						ax.set_ylabel('Tägliche Impfungen')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						save_plot(plot_name)
 | 
				
			||||||
 | 
						plt.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					plot_vaccination_bar_graph_compare_both_vaccinations_six_weeks()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def plot_cumulative_two_vaccinations():
 | 
					def plot_cumulative_two_vaccinations():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	plot_name = 'cumulative_two_vaccinations'
 | 
						plot_name = 'cumulative_two_vaccinations'
 | 
				
			||||||
| 
						 | 
					@ -925,37 +963,41 @@ def render_dashboard():
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 5,
 | 
									'index': 5,
 | 
				
			||||||
				'filename': 'vaccination_bar_graph_compare_both_vaccinations',
 | 
									'filename': 'vaccination_bar_graph_compare_both_vaccinations',
 | 
				
			||||||
				'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)'
 | 
									'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung um 21 Tage versetzt)'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 6,
 | 
									'index': 6,
 | 
				
			||||||
 | 
									'filename': 'vaccination_bar_graph_compare_both_vaccinations_six_weeks',
 | 
				
			||||||
 | 
									'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung um 42 Tage versetzt)'
 | 
				
			||||||
 | 
								},{
 | 
				
			||||||
 | 
									'index': 7,
 | 
				
			||||||
				'filename': 'cumulative_two_vaccinations',
 | 
									'filename': 'cumulative_two_vaccinations',
 | 
				
			||||||
				'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung)'
 | 
									'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung)'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 7,
 | 
									'index': 8,
 | 
				
			||||||
				'filename': 'cumulative_two_vaccinations_percentage',
 | 
									'filename': 'cumulative_two_vaccinations_percentage',
 | 
				
			||||||
				'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung) in Prozent der Bevölkerung Deutschlands'
 | 
									'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung) in Prozent der Bevölkerung Deutschlands'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 8,
 | 
									'index': 9,
 | 
				
			||||||
				'filename': 'people_between_first_and_second',
 | 
									'filename': 'people_between_first_and_second',
 | 
				
			||||||
				'caption': 'Anzahl der Personen zwischen Erst- und Zweitimpfung, also Personen, die die erste Impfung erhalten haben, die zweite aber noch nicht'
 | 
									'caption': 'Anzahl der Personen zwischen Erst- und Zweitimpfung, also Personen, die die erste Impfung erhalten haben, die zweite aber noch nicht'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 9,
 | 
									'index': 10,
 | 
				
			||||||
				'filename': 'vaccination_rate',
 | 
									'filename': 'vaccination_rate',
 | 
				
			||||||
				'caption': 'Tägliche Impfrate sowie durchschnittliche Impfrate'
 | 
									'caption': 'Tägliche Impfrate sowie durchschnittliche Impfrate'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 10,
 | 
									'index': 11,
 | 
				
			||||||
				'filename': 'vaccination_done_days',
 | 
									'filename': 'vaccination_done_days',
 | 
				
			||||||
				'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Anzahl Tage, Gesamt und 7 Tage)'
 | 
									'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Anzahl Tage, Gesamt und 7 Tage)'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 11,
 | 
									'index': 12,
 | 
				
			||||||
				'filename': 'vaccination_done_weeks',
 | 
									'filename': 'vaccination_done_weeks',
 | 
				
			||||||
				'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Anzahl Wochen, Gesamt und 7 Tage)'
 | 
									'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Anzahl Wochen, Gesamt und 7 Tage)'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 12,
 | 
									'index': 13,
 | 
				
			||||||
				'filename': 'vaccination_done_dates',
 | 
									'filename': 'vaccination_done_dates',
 | 
				
			||||||
				'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Datum, Gesamt und 7 Tage)'
 | 
									'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Datum, Gesamt und 7 Tage)'
 | 
				
			||||||
			},{
 | 
								},{
 | 
				
			||||||
				'index': 13,
 | 
									'index': 14,
 | 
				
			||||||
				'filename': 'vaccination_done_dates_detail',
 | 
									'filename': 'vaccination_done_dates_detail',
 | 
				
			||||||
				'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Datum, Gesamt und 7 Tage)'
 | 
									'caption': 'Lineare Extrapolation der Erst- und Zweitimpfungen bis 70 % der Bevölkerung anhand der durchschnittlichen Impfrate (Datum, Gesamt und 7 Tage)'
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue