clauses.append( "'' using %d axis x1y2 with linespoints lc rgb 'black' title column(%d)" % (column, column)) return clauses dirname = "usa-pce-energy" ff_plot = GNUPlot("total-ff", "Fossil fuels (trillion Btu)", dirname) elec_plot = GNUPlot("total-elec", "Electricity (trillion Btu)", dirname) ff_iplot = GNUPlot("total-intensity-ff", "Fossil fuels (Btu per dollar)", dirname) elec_iplot = GNUPlot("total-intensity-elec", "Electricity (Btu per dollar)", dirname) ff_plot.style = "histogram" ff_iplot.style = "histogram" elec_plot.style = "histogram rowstacked" elec_iplot.style = "histogram rowstacked" for year in config.STUDY_YEARS: # args: year, is_hybrid, allow_imports, adjust for inflation iogen = common.iogen_for_year(year, True, True, True) iogen_standard = common.iogen_for_year(year, False, True, True) energy_codes = [] for i in range(len(eia.modified_sources)): source = eia.modified_sources[i] naics = eia.source_naics_map[source][year] energy_codes.append(naics)
fd_dollars = { "exports": export_n.sum(), "pce": Yn.get_pce().sum(), "imports": import_n.sum(), } ###### breakdown by fd sector dirname = "usa-pce-energy" for (key, vector) in fd_vectors.items(): fdgroup = bea.fd_sector_names[key] ikey = key + "-intensity" if key not in plots: plots[key] = GNUPlot(key, fdgroup + " (trillion Btu)", dirname) plots[key].style = "histogram" if ikey not in plots: plots[ikey] = GNUPlot(ikey, fdgroup + " (MMBtu per 2005$)", dirname) plots[ikey].style = "histogram" use_vector = L.matrix_mult(vector) for i in range(len(energy_codes)): code = energy_codes[i] name = eia.name_for_naics(code) value = use_vector.get_element(rowname=code) # bBtu # divide bBtu by 1000 for tBtu plots[key].set_value(year, name, value / 1000) # div bBtu by k$ for MMBtu/$ plots[ikey].set_value(year, name, value / fd_dollars[key])
"'' using %d axis x1y2 with linespoints lc rgb 'black' title column(%d)" % (column, column)) return clauses dirname = "usa-pce-energy" ff_plot = GNUPlot("total-ff", "Fossil fuels (trillion Btu)", dirname) elec_plot = GNUPlot("total-elec", "Electricity (trillion Btu)", dirname) ff_iplot = GNUPlot( "total-intensity-ff", "Fossil fuels (Btu per dollar)", dirname) elec_iplot = GNUPlot( "total-intensity-elec", "Electricity (Btu per dollar)", dirname) ff_plot.style = "histogram" ff_iplot.style = "histogram" elec_plot.style = "histogram rowstacked" elec_iplot.style = "histogram rowstacked" for year in config.STUDY_YEARS: # args: year, is_hybrid, allow_imports, adjust for inflation iogen = common.iogen_for_year(year, True, True, True) iogen_standard = common.iogen_for_year(year, False, True, True) energy_codes = [] for i in range(len(eia.modified_sources)): source = eia.modified_sources[i] naics = eia.source_naics_map[source][year] energy_codes.append(naics)