- matplotlib - paths: - ./NANUMGOTHIC.TTF - ./NANUMGOTHICBOLD.TTF - ./NANUMMYEONGJO.TTF - ./NANUMMYEONGJOBOLD.TTF

대한민국 인구

import matplotlib.pyplot as plt import matplotlib.font_manager as fm NanumGothic = fm.FontProperties(fname='./NANUMGOTHIC.TTF') NanumGothicBold = fm.FontProperties(fname='./NANUMGOTHICBOLD.TTF') NanumMyengjo = fm.FontProperties(fname='./NANUMMYEONGJO.TTF') NanumMyengjoBold = fm.FontProperties(fname='./NANUMMYEONGJOBOLD.TTF') fig = plt.figure() year = [ 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021] population = [ 45416339, 45858029, 46266256, 46684069, 46991171, 47335678, 47732558, 48021543, 48229948, 48386823, 48583805, 48782274, 48991779, 49268928, 49540367, 49773145, 50515666, 50734284, 50948272, 51141463, 51327916, 51529338, 51696216, 51778544, 51826059, 51849861, 51829023, 51638809 ] plt.title('연도별 인구변화', fontproperties=NanumMyengjoBold, fontsize=16); plt.plot(year, population ) plt.xlabel('연도', fontproperties=NanumMyengjo, fontsize=12) plt.ylabel('인구(1,000만단위)', fontproperties=NanumMyengjo, fontsize=12) fig