Skip to content

Commit 8654af5

Browse files
committed
fix: move ax.legend outside aggregation condition block
- Move ax.legend() outside the aggregation mode condition block - Ensure legend is always displayed regardless of aggregation mode - Fix issue where legend was missing when aggregation mode is disabled
1 parent 0e48433 commit 8654af5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graph_net/plot_ESt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ def main():
422422
x_max = int(np.ceil(max(all_x_coords)))
423423
ax.set_xticks(np.arange(x_min, x_max + 1))
424424

425-
ax.legend(fontsize=16, loc="best")
425+
# Always show legend (whether aggregated curves are added or not)
426+
ax.legend(fontsize=16, loc="best")
426427

427428
output_file = os.path.join(args.output_dir, "ES_result.png")
428429
plt.savefig(output_file, dpi=300, bbox_inches="tight")

0 commit comments

Comments
 (0)