File:Vladimir Putin Approval (Levada, 2020).png
Python3 code used to generate this graph. Data is copied manually from Levada.ru and saved into two separate ASCII files:
- approval.txt - approval (%) formatted as comma-separated integers (31,53,65...)
- dates.txt - dates of the corresponding approval polls formatted as comma-separated MM.YYYY strings (08.1999,09.1999,10.1999,11.1999...)
from numpy import loadtxt
from matplotlib import pyplot as plt
approval = loadtxt('approval.txt',delimiter=',')
dates = loadtxt('dates.txt',delimiter=',',dtype=str)
dates2 = [datetime.datetime.strptime(x, '%m.%Y') for x in dates]
x = dates2
y = approval
plt.plot(x,y)
plt.ylabel('Approval %')
plt.title('Vladimir Putin approval percentage (Levada, closed question)')
plt.grid(True)
plt.show()