import matplotlib.pyplot as plt
from cycler import cycler
import pandas as pd
df = pd.read_csv("data.tsv", index_col=0 , sep = "\t")
fig, ax = plt.subplots(figsize=(8, 5))
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Noto Sans']
plt.subplots_adjust(left=0.08, bottom=0.17, right=0.96, top=0.91)
ax.set_prop_cycle( plt.rcParams['axes.prop_cycle'] )
ax.plot(df)
ax.fill_between( df.index ,0, df["Total"].values, color="lightblue", alpha=0.2)
ax.set_axisbelow(True)
ax.legend(df.columns, fontsize=9, ncol=8, loc='upper center', frameon=True, facecolor="#dddddd")
ax.axvspan("under 50", "100-150", color="#dddddd",zorder=-1) #BG paint
plt.title("Household income of Japan (MHLW 2023)", fontsize=14)
plt.tick_params(labelsize=9, pad=4)
plt.xlabel("Household income (10,000 JPY)", fontsize=10)
plt.ylabel("Percentage", fontsize=11)
plt.xticks(df.index, rotation=60, fontsize=7)
plt.yticks(fontsize=10)
plt.ylim([0,18])
plt.margins(0.02)
plt.minorticks_on()
plt.grid(which='major',color='#999999',linestyle='-', axis="y")
plt.grid(which='minor',color='#eeeeee',linestyle='-', axis="y")
plt.savefig("image.svg")