import matplotlib.pyplot as plt import pandas as pd import numpy as np df = pd.read_csv("data.tsv", index_col=0 , sep = "\t") fig, ax = plt.subplots(figsize=(16, 8)) x = np.arange(df.index.size) ax.bar(x-0.2, df["Psychiatrists "] , color="#3b95d3", width=0.2, bottom=0) ax.bar(x, df["Psychologists"] , color="#D676AB", width=0.2, bottom=0) ax.bar(x+0.2, df["Mental Health Nurses"] , color="#9BBB59", width=0.2, bottom=0) ax.legend(df.columns, fontsize=14, ncol=3, loc='center' ,bbox_to_anchor=(0, -0.22, 1., .102) ) ax.set_axisbelow(True) plt.rcParams['font.family'] = 'sans-serif' plt.rcParams['font.sans-serif'] = ['Noto Sans Display'] plt.subplots_adjust(left=0.06, bottom=0.15, right=0.99, top=0.9) plt.title("Mental health workers, 2019 or nearest year (OECD Health)", fontsize=23) plt.tick_params(labelsize=10, pad=4) plt.xticks(x, df.index, rotation=35, size=10) plt.ylabel("per 1000 population", size=15) plt.yticks(fontsize=11) ax.minorticks_on() plt.grid(which='major',color='#999999',linestyle='-', axis="y") plt.grid(which='minor',color='#cccccc',linestyle='--', axis="y") plt.subplots_adjust(top =0.88) plt.savefig("image.svg")