File:Ghg pie chart.svg

Summary

Description
English: To create similar for another "Annex 1" country or year find the info in

http://di.unfccc.int/flex_annex1

Data is added mid-April for 2 years ago:be careful not to double count by overlapping categories,

and insert the figures into the code below.

(code could be improved to calculate the value for "Other" as currently it must be calculated manually)

Install Python and Matplot on your computer, amend the output file name for your country, run the program and upload to a new commons file.
Date
Source Own work
Author Chidgk1
SVG development
InfoField
Source code
InfoField

Python code

import matplotlib.pyplot as plt
import numpy as np

plt.rcdefaults()
plt.style.use('ggplot')
plt.rcParams['font.size'] = 25
plt.rcParams['patch.edgecolor'] = 'black'
plt.rcParams['lines.linewidth'] = 1
plt.figure(figsize=[12,12])

labels = ['Electricity from Coal', 'Road Transport', 'Manufacturing and Construction', 'Agriculture', 'Cement', 'Electricity from Gas', 'Home heating/cooking', 'Other']
values = [94,76,60,56,36,34,34,106]
colours = ['#754513','darkgrey','pink','green','lightgrey','khaki','yellow','white']
angle = 90

def func(pct, allvals):
    absolute = int(round(pct/100.*np.sum(allvals)))
    return "{:.2n}%\n({:d} mt)".format(pct, absolute)

patches, texts, autotexts = plt.pie(values, colors=colours, autopct=lambda pct: func(pct, values), pctdistance=0.6, labels=labels, labeldistance=1.1, shadow=False, startangle=angle)

for at in autotexts:
    at.set_fontsize(16.21)

plt.axis('equal')
plt.tight_layout()
plt.gca().set_position([0, 0, 1, 1])
plt.gcf().subplots_adjust(bottom=0.15)

plt.savefig('ghg_pie_chart.svg')

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#Ghg%20pie%20chart.svgCategory:Self-published work
Category:Greenhouse gas emissions by sector Category:English-language SVG pie charts
Category:CC-BY-SA-4.0 Category:English-language SVG pie charts Category:Greenhouse gas emissions by sector Category:Self-published work Category:Valid SVG created with Matplotlib code