File:Ghg pie chart Turkey 2019.svg

Original file(SVG file, nominally 576 × 432 pixels, file size: 37 KB)

Captions

Captions

Greenhouse gas emissions by Turkey in 2019 by source

Summary edit

Description
English: Greenhouse gas emissions by Turkey in 2019 by source with English captions. Data from https://unfccc.int/documents/271541 For details of which spreadsheet cells the data is from see code comments. Turkish version at File:Sera gazlar Türkiye 2019.svg
Date
Source Own work
Author Chidgk1
SVG development
InfoField
W3C grn 
The SVG code is valid.
Created with Matplotlib-logo 
This plot was created with Matplotlib.
Source code
InfoField

Python code

Source code
import matplotlib.pyplot as plt
import sys

lang = "en"
#lang = "tr"

#If text changed in future default size may chop off part of text so may need to set size
#fig = plt.figure(figsize=(width, height))
#fig = plt.figure(figsize=(6, 4))
fig = plt.figure()

# Set font size as default was a bit small to read
fontsize = 14

#Get current axes object
ax = fig.gca()

# Global warming potentials to compare other gases with CO2 - from Wikipedia article
GWP_CH4 = 34
GWP_N2O = 298

#2019 data from https://unfccc.int/documents/223579 Turkey. 2021 Common Reporting Format (CRF) Table
#New data yearly so please update above url on 15 April 2022 with 2020 data
year = "2019"

# TABLE 1.A(a)  SECTORAL BACKGROUND DATA  FOR  ENERGY 1.A.1.a.i
# Electricity Generation Solid Fuels
# kt CO2
# Current spreadsheet cell G33 (G26 includes Combined Heat and Power)
Electricity_coal = 111831.754987763

# Electricity Generation Gaseous Fuels
# G34 (G27 includes Combined Heat and Power)
Electricity_gas = 18401.2644714952

# 1.A.3  b.  Road transportation
# G19 (cars have row G27 below for 2019 but there is no data in it - check 2020 data when it comes)
Road_transport = 75130.6078992

# 1.A.4 a.  Commercial/institutional energy G16
Work_buildings = 14609.5245130065

# 1.A.4  b.  Residential G30
Home_fuel = 41846.130574826

# 2A1 1. G10 (cement production)
Cement = 30423.1235019852

# 3A. F9 Enteric fermentation 1.   Cattle
Cattle_enteric_fermentation = 1074.09473919024 * GWP_CH4 # Convert methane to CO2eq

#3B.  J9 for CH3 & T10 for N2O on different sheets Manure management 1.    Cattle
Cattle_manure = (140.30660625 * GWP_CH4) + (6.30810021259532 * GWP_N2O) 

Cattle = Cattle_enteric_fermentation + Cattle_manure


# Total without LULUCF from National Inventory Report or elsewhere
total_Mt = 506.1
total = total_Mt * 1000

Other = total - (Electricity_coal + Road_transport + Cattle + Home_fuel + Cement + Electricity_gas)

#Put in order of size to make easier to compare
percents = [Electricity_coal,    Road_transport, Cattle, Home_fuel, Cement, Electricity_gas, Other]

# From https://learnui.design/tools/data-color-picker.html#palette
colors = ['#4f4c4c', '#7e5853', '#a86452', '#cd7548', '#eb8a34', '#ffa600', 'whitesmoke']
# Or you can use color names like:
#colors = ['peru'               ,'grey'      ,'pink'       ,'lightgrey','orange','khaki'          ,'whitesmoke']


if lang == "en":
 plt.title ("Greenhouse gases largest sources in Turkey " + year, fontsize = fontsize)
 autopct='%1.0f%%' # % sign after number in English
 labels = ['Electricity (coal)','Road Transport','Cattle','Home fuel','Cement','Electricity (gas)','Other']
 plt.xlabel('Source: Turkish Statistical Institute https://unfccc.int/documents/271541', fontsize = 'small', color = 'grey')
elif lang == "tr":
 plt.title (year + " Türkiye'de sera gazı emisyon kaynakları",  fontsize = fontsize)
 autopct='%%%1.0f' # % sign before number in Turkish
 labels = ['Kömürden Elektriği', 'Karayolu Ulaşim',   'Sığırlar',  'Evler',    'Çimento','Doğalgazdan Elektriği', 'Diğer']
 plt.xlabel('Kaynak: Türkiye İstatistik Kurumu https://unfccc.int/documents/271541', fontsize = 'small', color = 'grey')
else:
 print("Unknown language " + lang)
 sys.exit()  

ax.pie(percents, labels=labels, textprops={'fontsize': fontsize}, colors=colors, counterclock=False, startangle=90)
# Or if you want percents use below but that also puts % on the "other" slice
#ax.pie(percents, labels=labels, textprops={'fontsize': 10}, colors=colors, autopct=autopct, counterclock=False, startangle=90)

if lang == "en":
 plt.savefig('ghg_pie_chart_Turkey_' + year + '.svg')
elif lang == "tr":
 plt.savefig('sera_gazlar_Türkiye_' + year + '.svg')
else:
 print("Unknown language " + lang)
 sys.exit()  

plt.show()

Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

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

Date/TimeThumbnailDimensionsUserComment
current12:17, 14 April 2021Thumbnail for version as of 12:17, 14 April 2021576 × 432 (37 KB)Chidgk1 (talk | contribs)Uploaded own work with UploadWizard

Metadata