Keywords: U.S. Electricity Production 2015.svg en A graph showing U S energy production for the year 2015 Data from the https //www eia gov/electricity/monthly/epm_table_grapher cfm t epmt_1_01 U S Energy Information Administration 2016-11-23 own Douglas Perkins other versions The SVG file was produced using MatPlotLib with the following also Public Domain code <pre> /usr/bin/env python from matplotlib import pyplot from matplotlib import ticker from matplotlib import numpy This generates a bar graph showing the U S 's electricity production in 2015 https //www eia gov/electricity/monthly/ https //www eia gov/electricity/monthly/epm_table_grapher cfm t epmt_1_01 This file was written by Douglas Perkins It is released under a Creative Commons Zero 1 0 license https //creativecommons org/publicdomain/zero/1 0/ Renewable energy production in TWh petroleum_liquids 17 456 petroleum_coke 10 987 petroleum petroleum_liquids + petroleum_coke Energy production in TWh data Coal 1356 057 Gas 1335 068 Nuclear 797 178 Renewable\n non-solar 271 885 Hydro 251 168 Solar 37 371 Oil petroleum sources d0 for d in data amounts d1 for d in data A formatter to display comma-separated numbers on the y axis def comma_func x pos s ' 0 d ' format int x return s comma_format ticker FuncFormatter comma_func Make a bar graph x numpy arange len sources + 0 25 width 0 5 pyplot figure num 1 figsize 9 3 pyplot title U S Electricity Production 2015 pyplot bar x amounts width color 'gold' pyplot xlabel 'Source' pyplot ylabel 'Electricity TWh ' yticks pyplot xticks x + width/2 0 sources pyplot xticks rotation 'vertical' pyplot subplot 111 yaxis set_major_formatter comma_format pyplot subplot 111 grid b True axis 'y' pyplot savefig 'Chapter 7 US Electricity Production 2015 svg' format 'svg' bbox_inches 'tight' </pre> cc-zero Energy statistics of the United States |