import numpy as np
import matplotlib.pyplot as plt
import sys
lang = "en"
#lang = "tr"
Azerbaijan_Shah_Deniz1 = np.array([11 ,11 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ])
Algeria = np.array([4.444 ,4.444 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ])
Russia_Bluestream = np.array([16 ,16 ,16 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ])
Russia_Turkstream_BOTAS = np.array([5.75 ,5.75 ,5.75 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ])
Iran = np.array([9.6 ,9.6 ,9.6 ,9.6 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ])
Azerbaijan_Shah_Deniz2 = np.array([6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ])
Oman = np.array([1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ,1.4 ])
year = ['2023','2024','2025','2026','2027','2028','2029','2030','2031','2032','2033']
if lang == "en":
plt.title ("Contracts for gas supply to Turkey")
plt.ylabel("Billion cubic metres")
plt.xlabel("Sources: oxfordenergy.org/publications/turkeys-supply-demand-balance-and-renewal-of-its-ltcs/ page 22 \nreuters.com/business/energy/turkey-seals-11-bcm-natural-gas-accord-with-azerbaijan-minister-2021-10-15/ \nreuters.com/business/energy/turkey-signs-10-yr-gas-deal-with-oman-turkish-energy-minister-2023-01-30/", fontsize = 'x-small', color = 'grey')
label_AZ_SD2 = "Azerbaijan Shah Deniz 2"
label_OM = "Oman"
label_IR = "Iran"
label_RU_TS_GV = "Russia Turkstream"
label_RU_BS = "Russia Bluestream"
label_AL = "Algeria"
label_AZ_SD1 = "Azerbaijan Shah Deniz 1"
elif lang == "tr":
plt.title ("Türkiyenin gaz kontratları")
plt.ylabel("Milyar metre küp")
plt.xlabel("Kaynaklar: oxfordenergy.org/publications/turkeys-supply-demand-balance-and-renewal-of-its-ltcs/ sayfa 22 \nreuters.com/business/energy/turkey-seals-11-bcm-natural-gas-accord-with-azerbaijan-minister-2021-10-15/ \nreuters.com/business/energy/turkey-signs-10-yr-gas-deal-with-oman-turkish-energy-minister-2023-01-30/", fontsize = 'x-small', color = 'grey')
label_AZ_SD2 = "Azarbeycan Şahdeniz 2"
label_OM = "Umman"
label_IR = "İran"
label_RU_TS_GV = "Rusya TürkAkım"
label_RU_BS = "Rusya MaviAkım"
label_AL = "Cezayir"
label_AZ_SD1 = "Azarbeycan Şahdeniz 1"
else:
print("Unknown language " + lang)
sys.exit()
#Don't need the year dash marks
plt.tick_params(bottom=False,left=False)
#Put last to finish at bottom
plt.bar(year, Azerbaijan_Shah_Deniz2, width=1, color="yellow")
plt.bar(year, Oman, bottom=Azerbaijan_Shah_Deniz2, width=1, color="pink")
plt.bar(year, Iran, bottom=Azerbaijan_Shah_Deniz2+Oman, width=1, color="green")
plt.bar(year, Russia_Bluestream, bottom=Azerbaijan_Shah_Deniz2+Oman+Iran, width=1, color="blue")
plt.bar(year, Russia_Turkstream_BOTAS, bottom=Azerbaijan_Shah_Deniz2+Oman+Iran+Russia_Bluestream, width=1, color="red")
plt.bar(year, Azerbaijan_Shah_Deniz1, bottom=Azerbaijan_Shah_Deniz2+Oman+Iran+Russia_Bluestream+Russia_Turkstream_BOTAS, width=1, color="yellow")
plt.bar(year, Algeria, bottom=Azerbaijan_Shah_Deniz2+Oman+Iran+Russia_Bluestream+Russia_Turkstream_BOTAS+Azerbaijan_Shah_Deniz1,width=1, color="silver")
plt.text(3.6 ,2 ,label_AZ_SD2)
plt.text(3.6 ,6 ,label_OM)
plt.text(3.6 ,11 ,label_IR)
plt.text(3.6 ,30 ,label_RU_BS)
plt.text(3.6 ,33 ,label_RU_TS_GV)
plt.text(3.6 ,44 ,label_AZ_SD1)
plt.text(3.6 ,52 ,label_AL)
#Horizontal years looked a bit cramped
#plt.xticks(rotation = 45)
#Avoid chopping off labels
plt.tight_layout()
# Save graphic
if lang == "en":
plt.savefig('gas_contracts_Turkey.svg')
elif lang == "tr":
plt.savefig("gaz_kontratları_Türkiye.svg")
else:
print("Unknown language " + lang)
sys.exit()
# Show graphic
plt.show()