energy_demand.plotting package

Submodules

energy_demand.plotting.basic_plot_functions module

Basic plotting functions

energy_demand.plotting.basic_plot_functions.cm2inch(*tupl)[source]

Convert input cm to inches (width, hight)

energy_demand.plotting.basic_plot_functions.export_legend(legend, filename='legend.png')[source]

Export legend as seperate file

energy_demand.plotting.basic_plot_functions.simple_smooth(x_list, y_list, num=500, spider=False, interpol_kind='quadratic')[source]
energy_demand.plotting.basic_plot_functions.smooth_data(x_list, y_list, num=500, spider=False, interpol_kind='quadratic')[source]

Smooth data

x_listlist

List with x values

y_listlist

List with y values

numint

New number of interpolation points

spiderbool

Criteria whether spider plot or not

interpol_kindstr

Kind of interpolation, i.e. quadratic or cubic

energy_demand.plotting.basic_plot_functions.smooth_line(input_x_line_data, input_y_line_data, nr_line_points=1000)[source]

https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splrep.html#scipy.interpolate.splrep

nr_line_pointsint

represents number of points to make between input_line_data.min and T.max

energy_demand.plotting.choropleth_mapping module

energy_demand.plotting.creage_gif module

Create dynamic gif file from results

VALID_EXTENSIONS = (‘png’, ‘jpg’)

http://www.idiotinside.com/2017/06/06/create-gif-animation-with-python/

energy_demand.plotting.creage_gif.create_gif(filenames, duration, path)[source]
energy_demand.plotting.creage_gif.get_all_results(path_to_scenario, file_name_part)[source]

energy_demand.plotting.fig3_weather_at_home_plot module

energy_demand.plotting.fig_3_plot_over_time module

energy_demand.plotting.fig_3_weather_map module

energy_demand.plotting.fig_cross_graphs module

energy_demand.plotting.fig_cross_graphs.plot_cross_graphs(base_yr, comparison_year, regions, ed_year_fueltype_regs_yh, reg_load_factor_y, fueltype_int, fueltype_str, fig_name, label_points, plotshow)[source]
energy_demand.plotting.fig_cross_graphs.plot_cross_graphs_scenarios(base_yr, comparison_year, regions, scenario_data, fueltype_int, fueltype_str, fig_name, label_points, plotshow)[source]

energy_demand.plotting.fig_enduse_yh module

energy_demand.plotting.fig_enduse_yh.run(name_fig, path_result, ed_yh, days_to_plot=365, plot_crit=False)[source]

Plot individual enduse

energy_demand.plotting.fig_fuels_enduses_week module

energy_demand.plotting.fig_fuels_enduses_week.run(results_resid, lookups, hours_to_plot, year_to_plot, fig_name)[source]

Plots stacked end_use for all regions. As input GWh per h are provided, which cancels out to GW.

Parameters
  • year_to_plot (int) – 2015 –> 0

  • INFO Cannot plot a single year? (#) –

energy_demand.plotting.fig_fuels_enduses_y module

energy_demand.plotting.fig_fuels_enduses_y.run(results, lookups, fig_name, plotshow=False)[source]

Plot lines with total energy demand for all enduses per fueltype over the simluation period. Annual GWh are converted into GW.

Parameters
  • results (dict) – Results for every year and fueltype (yh)

  • lookups (dict) – Lookup fueltypes

  • fig_name (str) – Figure name

Note

Values are divided by 1‘000

energy_demand.plotting.fig_fuels_peak_h module

energy_demand.plotting.fig_lf module

energy_demand.plotting.fig_lf.create_min_max_polygon_from_lines(line_data)[source]
Parameters

line_data (dict) –

linedata containing info

{‘x_value’: [y_values]}

energy_demand.plotting.fig_lf.order_polygon(upper_boundary, lower_boundary)[source]

Create correct sorting to draw filled polygon

Parameters
  • upper_boundary

  • lower_boundary

energy_demand.plotting.fig_lf.plot_lf_y(fueltype_int, fueltype_str, reg_load_factor_y, reg_nrs, path_plot_fig, plot_individ_lines=False, plot_max_min_polygon=True)[source]

Plot load factors per region for every year

energy_demand.plotting.fig_lf.plot_seasonal_lf(fueltype_int, fueltype_str, load_factors_seasonal, reg_nrs, path_plot_fig, plot_individ_lines=False, plot_max_min_polygon=True)[source]

Plot load factors per region for every year

Parameters
  • fueltype_int (int) – Fueltype_int to print (see lookup)

  • fueltype_str (str) – Fueltype string to print

  • load_factors_seasonal (dict) – Seasonal load factors per season

  • reg_nrs (int) – Number of region

energy_demand.plotting.fig_load_profile_dh_multiple module

energy_demand.plotting.fig_lp module

energy_demand.plotting.fig_lp.plot_lp_dh(data_dh_modelled, path_plot_fig, fig_name)[source]

plot daily profile

energy_demand.plotting.fig_one_fueltype_multiple_regions_peak_h module

energy_demand.plotting.fig_p2_annual_hours_sorted module

energy_demand.plotting.fig_p2_spatial_val module

energy_demand.plotting.fig_p2_spatial_weather_map module

energy_demand.plotting.fig_p2_temporal_validation module

energy_demand.plotting.fig_p2_total_demand_national_scenarios module

energy_demand.plotting.fig_p2_weather_val module

energy_demand.plotting.fig_spatial_distribution_of_peak module

energy_demand.plotting.fig_stacked_enduse module

Plot stacked enduses for each submodel

energy_demand.plotting.fig_stacked_enduse.run(years_simulated, results_enduse_every_year, enduses, color_list, fig_name, plot_legend=True)[source]

Plots stacked energy demand

Parameters
  • years_simulated (list) – Simulated years

  • results_enduse_every_year (dict) – Results [year][enduse][fueltype_array_position]

  • enduses

  • fig_name (str) – Figure name

Note

  • Sum across all fueltypes

  • Not possible to plot single year

https://matplotlib.org/examples/pylab_examples/stackplot_demo.html

energy_demand.plotting.fig_stacked_enduse_sectors module

Plot stacked enduses per sector

energy_demand.plotting.fig_stacked_enduse_sectors.run(lookups, years_simulated, results_enduse_every_year, rs_enduses, ss_enduses, is_enduses, fig_name)[source]

Plots summarised endues for the three sectors. Annual GWh are converted into GW.

Parameters
  • data (dict) – Data container

  • results_objects

  • enduses_data

Note

  • Sum across all fueltypes

# INFO Cannot plot a single year?

energy_demand.plotting.fig_total_demand_peak module

energy_demand.plotting.fig_weather_variability_priod module

energy_demand.plotting.figs_p2 module

energy_demand.plotting.plotting_multiple_scenarios module

energy_demand.plotting.plotting_results module

energy_demand.plotting.plotting_styles module

Plotting styles

energy_demand.plotting.plotting_styles.color_list()[source]

List with colors

energy_demand.plotting.plotting_styles.color_list_scenarios()[source]
energy_demand.plotting.plotting_styles.color_list_selection()[source]
energy_demand.plotting.plotting_styles.color_list_selection_dm()[source]
energy_demand.plotting.plotting_styles.font_info(family='arial', color='black', weight='normal', size=8)[source]
energy_demand.plotting.plotting_styles.get_colorbrewer_color(color_prop, color_palette, inverse=False)[source]

Get hex color from colorbrewer

Parameters
  • color_prop (str) – Sequential or qualitative color criteria

  • color_palette (str) – Name of colorbrewer palette

  • invers (default (False)) – Invert color criteria

energy_demand.plotting.plotting_styles.is_color_list_selection()[source]
energy_demand.plotting.plotting_styles.linestyles()[source]

https://matplotlib.org/gallery/lines_bars_and_markers/linestyles.html

energy_demand.plotting.plotting_styles.marker_list()[source]

markers

energy_demand.plotting.plotting_styles.rs_color_list_selection()[source]
energy_demand.plotting.plotting_styles.ss_color_list_selection()[source]

energy_demand.plotting.result_mapping module

energy_demand.plotting.validation_enduses module

Validation plots

energy_demand.plotting.validation_enduses.plot_dataframe_function(my_df, x_column_name, y_column_names, from_to_value_to_plot=[], plot_kind='line')[source]