File:Primary energy supply in Turkey.svg

Summary

Description
English: Primary energy supply in Turkey by source and year.
Date
Source Own work based on: Sheet:BİN TEP yyyy Row 12:ENERJİ ÜRÜNLERİ ARZI. enerji.gov.tr.
Author Chidgk1
SVG development
InfoField
Source code
InfoField

Python code

Source code
# When amending please keep colors and order same as energy graph

lang = "en"
#lang = "tr"

import numpy as np
import matplotlib.pyplot as plt
import sys
import seaborn as sns

# Data from https://enerji.gov.tr/eigm-raporlari Ulusal Enerji Denge Tabloları Sheet:BİN TEP yyyy Row 12:Enerji̇ Ürünleri̇ Arzi
year                  = ['2014','2015','2016','2017','2018','2019','2020','2021']

Taş_Kömürü            = [20199, 22428, 23597, 24707, 24679, 25120, 25449, 23444]
Linyit                = [12702, 11446, 13556, 13791, 15086, 15453, 13863, 16672]
Asfaltit              = [  372,   499,   778,   555,   697,  1022,   979,   707]
Kok                   = [  234,   299,   527,   504,   513,   420,   430,   744]
# Combine different types of coal
# Could not see how to add more than 2 arrays
Kömür                 = np.add(Taş_Kömürü,Linyit).tolist()
Kömür                 = np.add(Kömür,     Asfaltit).tolist()
Kömür                 = np.add(Kömür,     Kok).tolist()

Ham_Petrol            = [20802, 28015, 28709, 29491, 25099, 35448, 34393, 36241]
Petrol_Ürünleri       = [10823, 11194, 13495, 14786, 16814,  6006,  7797,  7742]
# Combine different types of oil
Petrol                = np.add(Ham_Petrol,Petrol_Ürünleri).tolist()

Doğalgaz              = [40201, 39651, 38338, 44319, 41171, 37128, 39806, 49231]
#Other (Diğer) is Bio and waste and may be wrong as not sure how to add up early years as categories changed for bio and waste
Diğer                 = [ 3495,  2938,  2843,  2531,  3014,  3157,  3396,  4099]
Hidrolik              = [ 3495,  5775,  5782,  5007,  5155,  7639,  6716,  4810]
Rüzgar                = [  733,  1002,  1334,  1540,  1716,  1869,  2135,  2704]
Jeotermal             = [ 3524,  4805,  6034,  7128,  8343,  9651, 10576, 11234]
Güneş                 = [  803,   828,   917,  1091,  1547,  1622,  1784,  2059]

# Convert to megatonnes as easier to read

coal          = np.divide(Kömür,                 1000).tolist()
oil           = np.divide(Petrol,                1000).tolist()
gas           = np.divide(Doğalgaz,              1000).tolist()
other         = np.divide(Diğer,                 1000).tolist()
hydro         = np.divide(Hidrolik,              1000).tolist()
wind          = np.divide(Rüzgar,                1000).tolist()
geothermal    = np.divide(Jeotermal,             1000).tolist()
solar         = np.divide(Güneş,                 1000).tolist()

if lang == "en":
 plt.title ("Primary energy supply in Turkey")
 plt.ylabel("Millions of tonnes of oil equivalent")
 plt.xlabel('Source: https://enerji.gov.tr/eigm-raporlari Ulusal Enerji Denge Tabloları Sheet:BİN TEP yyyy Row 12:Enerji̇ Ürünleri̇ Arzi', fontsize = 'x-small', color = 'grey')
 label_coal          = "coal"
 label_oil           = "oil"
 label_gas           = "gas"
 label_geothermal    = "geothermal"
 label_hydro         = "hydro"
 label_other         = "other"
 label_solar         = "solar"
 label_wind          = "wind"
elif lang == "tr":
 plt.title ("Türkiye'de birincil enerji arzı")
 plt.ylabel("Milyon TEP")
 labels = ["Kömür", "Petrol",  "Doğalgaz",  "Jeotermal", "Hidrolik", "Biyoenerji_ve_Atıklar", "Güneş", "Rüzgar"]
 plt.xlabel('Kaynak: https://enerji.gov.tr/eigm-raporlari Ulusal Enerji Denge Tabloları Tablo:BİN TEP yyyy Satır 12:Enerji̇ Ürünleri̇ Arzi', fontsize = 'x-small', color = 'grey')
 label_coal          = "kömür"
 label_oil           = "petrol"
 label_gas           = "gaz"
 label_geothermal    = "jeotermal"
 label_hydro         = "hidrolik"
 label_other         = "diğer"
 label_solar         = "güneş"
 label_wind          = "rüzgar"
else:
 print("Unknown language " + lang)
 sys.exit()

colors = ["brown","black","khaki","cornflowerblue","red","yellow","green","gray"]

plt.stackplot(year, coal, oil, gas, hydro, geothermal,  solar, wind, other, colors=colors)

#Position labels manually to make them quicker to read than a legend in a corner - might need slight adjustment as years added
plt.text(7.1,160,label_other,      fontsize = 'small')
plt.text(7.1,155,label_wind,       fontsize = 'small')
plt.text(7.1,150,label_solar,      fontsize = 'small')
plt.text(7.1,143,label_geothermal, fontsize = 'small')
plt.text(7.1,136,label_hydro,      fontsize = 'small')
plt.text(7.1,113,label_gas,        fontsize = 'large')
plt.text(7.1, 60,label_oil,        fontsize = 'large')
plt.text(7.1, 18,label_coal,       fontsize = 'large')

#Avoid chopping off labels
plt.tight_layout()


#Don't need the frame
sns.despine(bottom = True, left = True)

#Don't need the dash marks
plt.tick_params(left=False, bottom=False)

# Save graphic
if lang == "en":
 plt.savefig("primary_energy_Turkey.svg")
elif lang == "tr":
 plt.savefig("birincil_enerji_arzı_Türkiye.svg")
else:
 print("Unknown language " + lang)
 sys.exit()  

# Show graphic
plt.show()

# Resulting graph should be roughly similar to graph "Total primary energy supply (TPES) by source, Turkey"
# from https://www.iea.org/data-and-statistics but perhaps not exactly the same if Turkstat have revised their figures

Licensing

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.
Category:CC-BY-SA-4.0#Primary%20energy%20supply%20in%20Turkey.svgCategory:Self-published work
Category:Energy in Turkey Category:English-language SVG charts Category:Primary energy Category:Charts showing data through 2021 Category:Charts of Turkey
Category:CC-BY-SA-4.0 Category:Charts of Turkey Category:Charts showing data through 2021 Category:Energy in Turkey Category:English-language SVG charts Category:Primary energy Category:Self-published work Category:Valid SVG created with Matplotlib code