Skip to content

Commit 631424b

Browse files
committed
Make figure 5 and 6 match guidelines
1 parent 0e28784 commit 631424b

File tree

4 files changed

+72
-234
lines changed

4 files changed

+72
-234
lines changed

papers/Martin_Staadecker_Value_of_LDES_and_Factors/LDES_paper_graphs/Figure LDES cycles.py

Lines changed: 0 additions & 202 deletions
This file was deleted.
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111

1212
from papers.Martin_Staadecker_Value_of_LDES_and_Factors.LDES_paper_graphs.util import (
1313
set_style,
14-
get_set_e_scenarios,
14+
get_set_e_scenarios, save_figure,
1515
)
1616
from switch_model.tools.graph.main import GraphTools
1717

1818
# Prepare graph tools
19-
tools = GraphTools(scenarios=get_set_e_scenarios())
19+
tools = GraphTools(scenarios=get_set_e_scenarios(), set_style=False)
2020
tools.pre_graphing(multi_scenario=True)
2121

2222
# %% CREATE FIGURE
2323
set_style()
2424
plt.close()
2525
fig = plt.figure()
26-
fig.set_size_inches(12, 12)
26+
fig.set_size_inches(6.850394, 6.850394)
2727
gs = matplotlib.gridspec.GridSpec(2, 2, figure=fig)
2828
ax1 = fig.add_subplot(gs[0, 0])
2929
ax2 = fig.add_subplot(gs[0, 1])
@@ -162,6 +162,8 @@
162162
demand = demand.groupby("timepoint", as_index=False).value.sum()
163163
demand = tools.transform.timestamp(demand, use_timepoint=True)
164164
demand = demand.set_index("datetime")["value"]
165+
demand *= 4 * 1e-6 # Each timestep is 4 hours, converting to TWh
166+
total_demand = demand.sum()
165167
demand = demand.resample(freq).mean()
166168
demand = demand * 60 / demand.max()
167169

@@ -181,7 +183,7 @@
181183

182184
lines = ax.get_lines()
183185
x_label = {
184-
4.0: 135,
186+
# 4.0: 135,
185187
8.0: 150,
186188
20.0: 170,
187189
24.0: 230,
@@ -193,14 +195,15 @@
193195
label = float(line.get_label())
194196
if label not in x_label.keys():
195197
continue
196-
labellines.labelLine(line, state_of_charge.index[x_label[label]], label="S "+str(int(label)), align=False, color='k')
198+
labellines.labelLine(line, state_of_charge.index[x_label[label]], linespacing=1, outline_width=1, label=str(int(label))+"TWh", align=False, color='k', fontsize="small")
197199

198200
demand_lines = ax.plot(demand, c="dimgray", linestyle="--", alpha=0.5)
199-
ax.legend(demand_lines, ["Demand"])
201+
ax.legend(demand_lines, [f"Demand ({total_demand:.0f} TWh/year)"])
200202

201203
ax.set_title("C. State of charge throughout the year")
202-
# %%
204+
# %% SAVE FIGURE
203205
plt.tight_layout()
206+
save_figure("figure-5-impact-of-ldes-on-grid.png")
204207

205208
# %% CALCULATIONS
206209
cap_total = cap["Solar"] + cap["Wind"]

0 commit comments

Comments
 (0)