def plot_installed_capacities(solution,
                              types=['supply', 'conversion', 'storage'],
                              unit_multiplier=1.0,
                              unit_label='kW',
                              **kwargs):
    """
    Plot installed capacities (``e_cap``) with a bar plot.

    Parameters
    ----------
    types : list, default ['supply', 'conversion', 'storage']
        Technology types to include in the plot.
    unit_multiplier : float or int, default 1.0
        Multiply installed capacities by this value for plotting.
    unit_label : str, default 'kW'
        Label for capacity values, adjust this when
        changing ``unit_multiplier``.
    **kwargs : are passed to ``pandas.DataFrame.plot()``

    """
    query_string = au._get_query_string(types)
    md = solution.metadata.to_pandas()
    supply_cap = md.query(query_string).index.tolist()

    df = solution['e_cap'].loc[dict(y=supply_cap)].to_pandas()

    weighted = md.stack_weight.sort_values(ascending=False).index.tolist()
    stacked_techs = [y for y in weighted if y in df.columns]

    df = df.loc[:, stacked_techs] * unit_multiplier

    names = [md.at[y, 'name'] for y in df.columns]
    colors = [md.at[i, 'color'] for i in df.columns]
    colormap = ListedColormap(colors)
    proxies = [plt.Rectangle((0, 0), 1, 1, fc=i)
               for i in colors]

    # Order the locations nicely, but only take those locations that actually
    # exists in the current solution
    if ('metadata' in solution.config_model and
            'location_ordering' in solution.config_model.metadata):
        meta_config = solution.config_model.metadata
        for index, item in enumerate(meta_config.location_ordering):
            if item in df.index:
                df.at[item, 'ordering'] = index
        df = df.sort_values(by='ordering', ascending=False)
        df = df.drop('ordering', axis=1)

    ax = df.plot(kind='barh', stacked=True, legend=False, colormap=colormap,
                 **kwargs)
    leg = au.legend_outside_ax(ax, where='right', artists=proxies, labels=names)

    ylab = ax.set_ylabel('')
    xlab = ax.set_xlabel('Installed capacity ({})'.format(unit_label))

    return ax
dataset/ETHPy150Open calliope-project/calliope/calliope/analysis.py/plot_installed_capacities/original