概要
Graph data
import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv("data.tsv", index_col=0 , sep = "\t") df = df.fillna(0) df = df.sort_values("Total") fig, ax = plt.subplots(figsize=(16, 8)) ax.bar(df.index, df["Inpatient"] , color="#93CDDD", width=0.7, bottom=0) ax.bar(df.index, df["Outpatient"], color="#957ccb", width=0.7, bottom=df["Inpatient"] ) ax.bar(df.index, df["Long-term care"], color="#E69717", width=0.7 , bottom=df["Inpatient"]+df["Outpatient"] ) ax.bar(df.index, df["Ancillary services"] , color="#D83227", width=0.7, bottom=df["Inpatient"]+df["Outpatient"] + df["Long-term care"] ) ax.bar(df.index, df["Medical goods"] , color="#3cb371", width=0.7, bottom=df["Inpatient"]+df["Outpatient"] + df["Long-term care"] + df["Ancillary services"] ) ax.bar(df.index, df["Preventive care"] , color="#D676AB", width=0.7, bottom=df["Inpatient"]+df["Outpatient"] + df["Long-term care"] + df["Ancillary services"] + df["Medical goods"] ) ax.bar(df.index, df["Administration"] , color="#a52a2a", width=0.7, bottom=df["Inpatient"]+df["Outpatient"] + df["Long-term care"] + df["Ancillary services"] + df["Medical goods"] + df["Preventive care"]) ax.bar(df.index, df["Others"] , color="#aaa", width=0.7, bottom=df["Inpatient"]+df["Outpatient"] + df["Long-term care"] + df["Ancillary services"] + df["Medical goods"] + df["Preventive care"] + df["Administration"] ) ax.legend(df.columns, fontsize=12, ncol=5, loc='center' ,bbox_to_anchor=(0., -0.23, 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.05, bottom=0.22, right=0.96, top=0.8) plt.title("Health expenditure by function, 2018 (OECD Health)", fontsize=28) plt.tick_params(labelsize=10, pad=4) plt.xticks(df.index, rotation=40, size=9) plt.ylim([0,16]) plt.ylabel("% of GDP", size=15) plt.yticks(fontsize=13) plt.grid(which='major',color='#cccccc',linestyle='-', axis="y") plt.subplots_adjust(top =0.88) plt.savefig("image.svg")
==ライセンス==
この作品の著作権者である私は、この作品を以下のライセンスで提供します。
| このファイルはクリエイティブ・コモンズ CC0 1.0 全世界 パブリック・ドメイン提供のもとで利用可能にされています。 |
ある作品に本コモンズ証を関連づけた者は、その作品について世界全地域において著作権法上認められる、その者が持つすべての権利(その作品に関する権利や隣接する権利を含む。)を、法令上認められる最大限の範囲で放棄して、パブリック・ドメインに提供しています。 この作品は、たとえ営利目的であっても、許可を得ずに複製、改変・翻案、配布、上演・演奏することが出来ます。 http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |