File:Healthy Life Years and LEB.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 565 × 1,517 pixels, file size: 433 KB)

Captions

Captions

Life expectancy and Healthy life expectancy (WHO,2019)
This file may be updated to reflect new information.
If you wish to use a specific version of the file without it being overwritten, please upload the required version as a separate file.

Summary

[edit]
Description
English: Life expectancy and Healthy life expectancy (WHO,2019)
Date
Source Own work, Data from WHO https://apps.who.int/gho/data/node.main.688
Author Yuasan
Permission
(Reusing this file)
CC-0

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

graph data

[edit]
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

df = pd.read_csv("data.tsv", index_col=0 , sep = "\t")
df = df.sort_values(by=["Life expectancy"], ascending=True)
x = np.arange(df.index.size)

fig, ax = plt.subplots(figsize=(5, 20))

cmap = mpl.colormaps['tab10']
ax.barh(df.index, df["Life expectancy"] , color=cmap(1) )
ax.barh(df.index, df["Healthy life expectancy"] , color=cmap(2) )
ax.set_axisbelow(True)

plt.rcParams['font.sans-serif'] = ['Noto Sans JP']
plt.rcParams['font.family'] = 'sans-serif'
plt.subplots_adjust(left=0.1, bottom=0.05, right=1, top=0.95)

plt.title("Life expectancy and Healthy life expectancy (WHO,2019)", fontsize=13)
plt.tick_params(labelsize=9, pad=4)

plt.xlabel("year (at birth)", fontsize=9)
plt.yticks(fontsize=7)
plt.ylim(-0.5, len(df)-.5) 
plt.xlim([40,90])

ax.legend(df.columns, fontsize=9, ncol=1, loc='lower right',  frameon=True, facecolor="#dddddd")

ax.minorticks_on()
plt.grid(which='major',color='#cccccc',linestyle='-', axis="x")
plt.grid(which='minor',color='#cccccc',linestyle='--', axis="x")
plt.subplots_adjust(top =0.85)

plt.savefig("image.svg", bbox_inches='tight')
Any autoconfirmed user can overwrite this file from the same source. Please ensure that overwrites comply with the guideline.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:24, 12 March 2023Thumbnail for version as of 12:24, 12 March 2023565 × 1,517 (433 KB)Yuasan (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata