Plot time series
add_reserves(n)
plot_energy_balance(n, plot_config, bus_carrier='AC', start_date='2060-03-31 21:00', end_date='2060-04-06 12:00:00', aggregate_fossil=False, add_load_line=True, add_reserves=False, ax=None)
Plot the electricity balance of the network for the given time range
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network |
required |
plot_config
|
dict
|
the plotting config (snakemake.config["plotting"]) |
required |
bus_carrier
|
str
|
the carrier for the energy_balance op. Defaults to "AC". |
'AC'
|
start_date
|
str
|
the range to plot. Defaults to "2060-03-31 21:00". |
'2060-03-31 21:00'
|
end_date
|
str
|
the range to plot. Defaults to "2060-04-06 12:00:00". |
'2060-04-06 12:00:00'
|
aggregate_fossil
|
bool
|
whether to aggregate fossil fuels. Defaults to False. |
False
|
add_load_line
|
bool
|
add a dashed line for the load. Defaults to True. |
True
|
Source code in workflow/scripts/plot_time_series.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
plot_load_duration_curve(network, carrier='AC', ax=None)
Plot the load duration curve for the given carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypasa network object |
required |
carrier
|
str
|
the load carrier, defaults to AC |
'AC'
|
ax
|
Axes
|
figure axes, if none fig will be created. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the plotting axes |
Source code in workflow/scripts/plot_time_series.py
plot_price_duration_by_node(network, carrier='AC', logy=True, y_lower=0.001, fig_shape=(8, 4))
Plot the price duration curve for the given carrier by node Args: network (pypsa.Network): the pypsa network object carrier (str, optional): the load carrier, defaults to AC (bus suffix) logy (bool, optional): use log scale for y axis, defaults to True y_lower (float, optional): lower limit for y axis, defaults to 1e-3 fig_shape (tuple, optional): shape of the figure, defaults to (8, 4)
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the plotting axes |
Raises: ValueError: if the figure shape is too small for the number of regions
Source code in workflow/scripts/plot_time_series.py
plot_price_duration_curve(network, carrier='AC', ax=None, figsize=(8, 8))
Plot the price duration curve for the given carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypasa network object |
required |
carrier
|
str
|
the load carrier, defaults to AC |
'AC'
|
ax
|
Axes
|
Axes to plot on, if none fig will be created. Defaults to None. |
None
|
figsize
|
tuple
|
size of the figure (if no ax given), defaults to (8, 8) |
(8, 8)
|
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the plotting axes |
Source code in workflow/scripts/plot_time_series.py
plot_price_heatmap(network, carrier='AC', log_values=False, color_map='viridis', time_range=None, ax=None)
Plot the price heat map (region vs time) for the given carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypsa network object |
required |
carrier
|
str
|
the carrier for which to get the price. Defaults to "AC". |
'AC'
|
log_values
|
bool
|
whether to use log scale for the prices. Defaults to False. |
False
|
color_map
|
str
|
the color map to use. Defaults to "viridis". |
'viridis'
|
time_range
|
Index
|
the time range to plot. Defaults to None (all times). |
None
|
ax
|
Axes
|
the plotting axis. Defaults to None (new fig). |
None
|
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the axes for plotting |
Source code in workflow/scripts/plot_time_series.py
plot_regional_load_durations(network, carrier='AC', ax=None, cmap='plasma')
Plot the load duration curve for the given carrier stacked by region
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypasa network object |
required |
carrier
|
str
|
the load carrier, defaults to AC |
'AC'
|
ax
|
Axes
|
axes to plot on, if none fig will be created. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the plotting axes |
Source code in workflow/scripts/plot_time_series.py
plot_residual_load_duration_curve(network, ax=None, vre_techs=['Onshore Wind', 'Offshore Wind', 'Solar'])
Plot the residual load duration curve for the given carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypasa network object |
required |
ax
|
Axes
|
Axes to plot on, if none fig will be created. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
Axes
|
plt.Axes: the plotting axes |
Source code in workflow/scripts/plot_time_series.py
plot_vre_heatmap(n, config, color_map='magma', log_values=True, time_range=None)
Plot the VRE generation per hour and day as a heatmap
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the pypsa network object |
required |
time_range
|
Index
|
the time range to plot. Defaults to None (all times). |
None
|
log_values
|
bool
|
whether to use log scale for the values. Defaults to True. |
True
|
config
|
dict
|
the run config (snakemake.config). |
required |
Source code in workflow/scripts/plot_time_series.py
plot_vre_timemap(network, color_map='viridis', time_range=None)
Plot the VRE generation per hour and day as a heatmap
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network
|
Network
|
the pypsa network object |
required |
color_map
|
str
|
the color map to use. Defaults to "viridis". |
'viridis'
|
time_range
|
Index
|
the time range to plot. Defaults to None (all times). |
None
|