Plot statistics
add_second_xaxis(data, ax, label, **kwargs)
Add a secondary X-axis to the plot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Series
|
The data to plot. Its values will be plotted on the secondary X-axis. |
required |
ax
|
Axes
|
The main matplotlib Axes object. |
required |
label
|
str
|
The label for the secondary X-axis. |
required |
**kwargs
|
Optional keyword arguments for plot styling. |
{}
|
Source code in workflow/scripts/plot_statistics.py
plot_capacity_factor(cf_filtered, theo_cf_filtered, ax, colors, **kwargs)
Plot actual and theoretical capacity factors for each technology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cf_filtered
|
Series
|
Actual capacity factors indexed by technology. |
required |
theo_cf_filtered
|
Series
|
Theoretical capacity factors indexed by technology. |
required |
ax
|
Axes
|
The axis to plot on. |
required |
colors
|
dict
|
Color mapping for technologies. |
required |
Returns:
Type | Description |
---|---|
matplotlib.axes.Axes: The axis with the plot. |
Source code in workflow/scripts/plot_statistics.py
plot_province_peakload_capacity(df_plot, bar_cols, color_list, outp_dir)
Plot province peak load vs installed capacity by technology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df_plot
|
DataFrame with provinces as index, columns as technologies and 'Peak Load'. |
required | |
bar_cols
|
List of technology columns to plot as bars. |
required | |
color_list
|
List of colors for each technology. |
required | |
outp_dir
|
Output directory for saving the figure. |
required |
Source code in workflow/scripts/plot_statistics.py
plot_static_per_carrier(ds, ax, colors, drop_zero_vals=True, add_labels=True)
Generic function to plot different statics
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds
|
DataFrame
|
the data to plot |
required |
ax
|
Axes
|
plotting axes |
required |
colors
|
DataFrame
|
colors for the carriers |
required |
drop_zero_vals
|
bool
|
Drop zeroes from data. Defaults to True. |
True
|
add_labels
|
bool
|
Add value labels on bars. If None, reads from config. Defaults to None. |
True
|
Source code in workflow/scripts/plot_statistics.py
prepare_capacity_factor_data(n, carrier)
Prepare Series for actual and theoretical capacity factors per technology.
Returns:
Name | Type | Description |
---|---|---|
cf_filtered |
Series of actual capacity factors (index: nice_name) |
|
theo_cf_filtered |
Series of theoretical capacity factors (index: nice_name) |
Source code in workflow/scripts/plot_statistics.py
prepare_province_peakload_capacity_data(n, attached_carriers=None)
Prepare DataFrame for province peak load and installed capacity by technology.
Returns:
Name | Type | Description |
---|---|---|
df_plot |
DataFrame with provinces as index, columns as technologies and 'Peak Load'. |
|
bar_cols |
List of technology columns to plot as bars. |
|
color_list |
List of colors for each technology. |