|
7 | 7 | from matplotlib import cm |
8 | 8 | from matplotlib.ticker import PercentFormatter |
9 | 9 | from matplotlib.colors import Normalize |
| 10 | +import labellines |
10 | 11 |
|
11 | 12 | from papers.Martin_Staadecker_Value_of_LDES_and_Factors.LDES_paper_graphs.util import ( |
12 | 13 | set_style, |
|
83 | 84 | # Convert to percent against baseline |
84 | 85 | df = (df / df.iloc[0] - 1) * 100 |
85 | 86 |
|
86 | | -dotted_tx = df.loc[[1.94, 3, 20, 64], ["Built Transmission"]] |
| 87 | +# dotted_tx = df.loc[[1.94, 3, 20, 64], ["Built Transmission"]] |
87 | 88 |
|
88 | 89 | # Plot |
89 | 90 | colors = tools.get_colors() |
90 | 91 | colors["Built Transmission"] = "y" |
91 | 92 | colors["Built Generation"] = "r" |
92 | | -dotted_tx.plot(ax=ax, linestyle="dashed", color="y", alpha=0.8) |
| 93 | +# dotted_tx.plot(ax=ax, linestyle="dashed", color="y", alpha=0.8) |
93 | 94 | df.plot(ax=ax, marker=".", color=colors) |
94 | 95 | ax.set_ylabel("Change in capacity compared to baseline") |
95 | 96 | ax.yaxis.set_major_formatter(PercentFormatter()) |
|
178 | 179 | fraction=0.1, |
179 | 180 | ) |
180 | 181 |
|
181 | | -lines = ax.plot(demand, c="dimgray", linestyle="--", alpha=0.5) |
182 | | -ax.legend(lines, ["Demand"]) |
| 182 | +lines = ax.get_lines() |
| 183 | +x_label = { |
| 184 | + 4.0: 135, |
| 185 | + 8.0: 150, |
| 186 | + 20.0: 170, |
| 187 | + 24.0: 230, |
| 188 | + 32.0: 245, |
| 189 | + 48.0: 260, |
| 190 | + 64.0: 285 |
| 191 | +} |
| 192 | +for line in lines: |
| 193 | + label = float(line.get_label()) |
| 194 | + if label not in x_label.keys(): |
| 195 | + continue |
| 196 | + labellines.labelLine(line, state_of_charge.index[x_label[label]], label=str(int(label)), align=False, color='k') |
| 197 | + |
| 198 | +demand_lines = ax.plot(demand, c="dimgray", linestyle="--", alpha=0.5) |
| 199 | +ax.legend(demand_lines, ["Demand"]) |
183 | 200 |
|
184 | 201 | ax.set_title("C. State of charge throughout the year") |
185 | 202 | # %% |
|
200 | 217 | cap / cap.loc[20] - 1 # solar increase % |
201 | 218 | (cap - cap.loc[20]) / 1000 |
202 | 219 | # %% transmission |
203 | | -tx / tx.iloc[0] * 100 |
204 | | -(3 - 1.94) * 1000 / ((1 - tx.loc[3] / tx.iloc[0]) * 100) |
| 220 | +100 - tx / tx.iloc[0] * 100 |
| 221 | +# (3 - 1.94) * 1000 / ((1 - tx.loc[3] / tx.iloc[0]) * 100) |
| 222 | + |
0 commit comments