From 28d2cdc71a8f12a0684423316e54744a1053678f Mon Sep 17 00:00:00 2001 From: stefansc1 Date: Mon, 17 Nov 2025 17:32:10 +0100 Subject: [PATCH] fix legend z-order for mutliple axis in ext. plots --- simba/report.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simba/report.py b/simba/report.py index a6414f9..540977a 100644 --- a/simba/report.py +++ b/simba/report.py @@ -704,6 +704,17 @@ def plot_gc_power_timeseries(extended_plots_path, scenario, schedule, args): start_idx = i ax.legend() # fig.legend places legend outside of plot + # legend might be behind twin plots, so adjust z-order + # since this affects visibility, hide original axis frame + if has_battery_column: + ax.set_zorder(1) + ax.set_frame_on(False) + twin_bat.set_frame_on(True) + if has_prices: + ax.set_zorder(1) + ax.set_frame_on(False) + twin_price.set_frame_on(True) + # plt.xticks(rotation=30) ax.set_ylabel("Power [kW]") ax.set_title(f"Power: {gcID}")