Skip to content

Commit 898d608

Browse files
committed
change diff order in plot
1 parent d795386 commit 898d608

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/pypsa-de/regret_plots_lt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def plot_capacity_comparison(
9393

9494
# Build plotting table
9595
if plot_diff:
96-
# signed difference (compare - base)
97-
diff = (df[cmp_name] - df[base_name]).rename("Diff").to_frame()
96+
# signed difference (base - compare)
97+
diff = (df[base_name].abs() - df[cmp_name].abs()).rename("Diff").to_frame()
9898
df_plot_supply = diff.loc[supply_order.intersection(diff.index)]
9999
df_plot_demand = diff.loc[demand_order.intersection(diff.index)]
100100
plot_columns = ["Diff"]
@@ -189,7 +189,7 @@ def plot_capacity_comparison(
189189
mpatches.Patch(
190190
facecolor="white",
191191
edgecolor="black",
192-
label=f"{cmp_name}{base_name}",
192+
label=f"{base_name} - {cmp_name}",
193193
)
194194
]
195195
ax.legend(handles=handles, title="Difference")

0 commit comments

Comments
 (0)