|
8 | 8 | from ..misc.str_handler import clean_strings
|
9 | 9 | from ..common import commons
|
10 | 10 |
|
11 |
| -from .postprocessing import get_imports, get_plot_data, filter_by_zone |
| 11 | +from .postprocessing import get_imports, get_plot_data, filter_by_zone, filter_by_tech, filter_by_storage |
12 | 12 |
|
13 | 13 |
|
14 | 14 | def plot_dispatch(demand, plotdata, level=None, curtailment=None, shedload=None, rng=None,
|
@@ -140,16 +140,16 @@ def plot_dispatch(demand, plotdata, level=None, curtailment=None, shedload=None,
|
140 | 140 | # plt.legend(handles=[line_demand] + patches[::-1], loc=4)
|
141 | 141 |
|
142 | 142 | if shedload is None and level is None:
|
143 |
| - plt.legend(handles=[line_demand] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 1.3)) |
| 143 | + plt.legend(handles=[line_demand] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5)) |
144 | 144 | if shedload is None:
|
145 |
| - plt.legend(handles=[line_demand] + [line_SOC] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 1.3)) |
| 145 | + plt.legend(handles=[line_demand] + [line_SOC] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5)) |
146 | 146 | elif level is None:
|
147 |
| - plt.legend(handles=[line_demand] + [line_shedload] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 1.3)) |
| 147 | + plt.legend(handles=[line_demand] + [line_shedload] + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5)) |
148 | 148 | axes[0].fill_between(demand.index, demand, reduced_demand, facecolor="none", hatch="X", edgecolor="k",
|
149 | 149 | linestyle='dashed')
|
150 | 150 | else:
|
151 | 151 | plt.legend(title='Dispatch for ' + demand.name[1], handles=[line_demand] + [line_shedload] + [line_SOC] +
|
152 |
| - patches[::-1], loc=4, bbox_to_anchor=(1.2, 1.3)) |
| 152 | + patches[::-1], loc=4, bbox_to_anchor=(1.2, 0.5)) |
153 | 153 | axes[0].fill_between(demand.index, demand, reduced_demand, facecolor="none", hatch="X", edgecolor="k",
|
154 | 154 | linestyle='dashed')
|
155 | 155 |
|
@@ -327,7 +327,8 @@ def plot_zone(inputs, results, z='', rng=None, rug_plot=True):
|
327 | 327 | plotdata = get_plot_data(inputs, results, z) / 1000 # GW
|
328 | 328 |
|
329 | 329 | if 'OutputStorageLevel' in results:
|
330 |
| - level = filter_by_zone(results['OutputStorageLevel'], inputs, z) / 1E6 # TWh |
| 330 | + levels = filter_by_zone(results['OutputStorageLevel'], inputs, z) / 1E6 # TWh |
| 331 | + level = filter_by_storage(levels, inputs, StorageSubset='s') |
331 | 332 | level = level.sum(axis=1)
|
332 | 333 | else:
|
333 | 334 | level = pd.Series(0, index=results['OutputPower'].index)
|
|
0 commit comments