Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import matplotlib.dates as mdates
- import datetime
- plt.rcParams["figure.figsize"] = [20, 10]
- font = {'family' : 'serif',
- 'serif' : 'Times New Roman',
- 'size' : 40}
- plt.rc('font', **font)
- string_dates = ["31/07/2021", "31/08/2021", "30/09/2021", "20/10/2021", "22/10/2021", "24/10/2021",
- "29/10/2021", "01/11/2021", "03/11/2021", "05/11/2021", "08/11/2021", "10/11/2021"]
- migrants = [26, 500, 1903, 5665, 6162, 6657, 7300, 7832, 8059, 8407, 8833, 9087]
- dates = [datetime.datetime.strptime(d,"%d/%m/%Y").date() for d in string_dates]
- ax = plt.gca()
- formatter = mdates.DateFormatter("%Y-%m-%d")
- ax.xaxis.set_major_formatter(formatter)
- locator = mdates.MonthLocator()
- ax.xaxis.set_major_locator(locator)
- plt.title('Migranci z Białorusi przez Polskę stwierdzeni przez Niemcy')
- plt.xlabel('Data')
- plt.ylabel('Skumulowana liczba \n migrantów od początku roku')
- font = {'family' : 'serif',
- 'serif' : 'Times New Roman',
- 'size' : 18}
- plt.rc('font', **font)
- plt.text(datetime.datetime.strptime("31/07/2021","%d/%m/%Y").date(), 8000,
- 'Źródło: https://www.bundespolizei.de/Web/DE/04Aktuelles/01Meldungen/2021/10/staendige_aktualisierung_migrationslage.html \n'
- 'i podane tam wczesniejsze komunikaty policji federalnej')
- plt.plot(dates, migrants)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment