import matplotlib as mp
import matplotlib.pyplot as plt
from cycler import cycler
import pandas as pd
import matplotlib.ticker as ticker
df = pd.read_csv("data.tsv", index_col=0 , sep = "\t")
df = df.interpolate()
fig, ax = plt.subplots(figsize=(8, 5))
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Noto Sans Display']
plt.subplots_adjust(left=0.09, bottom=0.16, right=0.96, top=0.88)
ax.set_prop_cycle( plt.rcParams['axes.prop_cycle'] )
ax.plot(df, lw=2)
ax.set_axisbelow(True)
ax.xaxis.set_major_locator(ticker.MultipleLocator(2))
ax.margins(0.05)
plt.ylabel("Gini index", fontsize=12)
plt.ylim([0, 0.6])
fig.legend(df.columns, fontsize=10, ncol=10, loc='lower center',facecolor="#eeeeee")
plt.title("Gini and Income redistribution in Japan \n(MHLW Income redistribution survey)", fontsize=13)
plt.tick_params(labelsize=9, pad=4)
plt.xticks(rotation=35, fontsize=8)
plt.yticks(fontsize=10)
plt.grid(which='major',color='#eeeeee',linestyle='--', axis="x")
plt.grid(which='major',color='#cccccc',linestyle='-', axis="y")
plt.savefig("image.svg")
year Raw Income Gini Redistributed Income Gini
1962 0.3904 0.3442
1967 0.3749 0.3276
1972 0.3538 0.3136
1975 0.3747 0.3455
1978 0.3652 0.3381
1981 0.3491 0.3134
1984 0.3975 0.3426
1987 0.4049 0.3382
1990 0.4334 0.3643
1993 0.4394 0.3643
1996 0.4412 0.3606
1999 0.4720 0.3814
2002 0.4983 0.3812
2005 0.5263 0.3873
2008 0.5318 0.3758
2011 0.5536 0.3791
2014 0.5704 0.3759
2017 0.5594 0.3721
2021 0.5700 0.3813