onstove.OnStove.plot_costs_benefits#
- OnStove.plot_costs_benefits(variable: str = 'max_benefit_tech', labels: dict[str, str] | None = None, cmap: dict[str, str] | None = None, font_args: dict | None = None, legend_args: dict | None = None, height: float = 1.5, width: float = 2.5, save_as: str | None = None, dpi: int = 150) matplotlib.Figure [source]#
Displays a stacked bar plot with the aggregated total costs and benefits for the technologies with the highest net-benefits over the study area.
- Parameters:
- variable: str, default ‘max_benefit_tech’
Categorical variable to use to calculate the costs and benefits for (one stacked bar for each technology).
- labels: dictionary of str key-value pairs, optional
Dictionary with the keys-value pairs to use for the technology categories.
{'Collected Traditional Biomass': 'Biomass', 'Collected Improved Biomass': 'Biomass ICS (ND)', 'Traditional Charcoal': 'Charcoal', 'Biomass Forced Draft': 'Biomass ICS (FD)', 'Pellets Forced Draft': 'Pellets ICS (FD)'}
- cmap: dictionary of str key-value pairs, optional
Dictionary with the colors to use for each cost/benefit category.
>>> cmap = {'Health costs avoided': '#542788', ... 'Investment costs': '#b35806', ... 'Fuel costs': '#f1a340', ... 'Emission costs avoided': '#998ec3', ... 'Om costs': '#fee0b6', ... 'Opportunity cost gained': '#d8daeb'}
- font_args: dictionary, optional
A dictionary with font arguments. Default to
font_args=dict(size=10, color='black')
.- legend_args: dictionary, optional
A dictionary with legend arguments. Default to
legend_args=dict(legend_direction='vertical', ncol=1)
, but you can give options aslegend_args=dict(legend_position=(0.5, -0.6), legend_direction='horizontal', ncol=2)
.- height: float, default 1.5
The heihg of the figure in inches.
- width: float, default 2.5
The width of the figure in inches.
- save_as: str, optional
If a string is passed, then the plot will be saved with that name and extension file in the:attr:output_directory as
name.pdf
,name.png
,name.svg
, etc.- dpi: int, default 150
The resolution of the figure in dots per inch.
- Returns:
- matplotlib.Figure
Figure object used to plot the cost and benefits.