From 0fb3c045bbb011380a31bfabd273722f6513fa22 Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 3 Dec 2025 01:40:52 -0500 Subject: html_gen allow showing legend for explicit set of coroutines --- nemesis/html_gen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nemesis') diff --git a/nemesis/html_gen.py b/nemesis/html_gen.py index 2a417fc..85d2e5f 100644 --- a/nemesis/html_gen.py +++ b/nemesis/html_gen.py @@ -53,9 +53,12 @@ def plot_results(results: "collections.defaultdict[str, collections.defaultdict[ shared_yaxes=False, ) + all_coros = set() # used to not add a coro to the legend twice for coro_name, x_values in results.items(): for speedup, xx_values in x_values.items(): for loop, experiments in xx_values.items(): + show_legend = coro_name not in all_coros + all_coros.add(coro_name) col = loop_to_col[loop] x_list = [] @@ -109,7 +112,7 @@ def plot_results(results: "collections.defaultdict[str, collections.defaultdict[ mode='markers', name=coro_name, marker=dict(color=get_color(coro_name)), - showlegend=True, + showlegend=show_legend, ), row=1, col=col) fig.add_trace(go.Scatter( @@ -143,7 +146,7 @@ def plot_results(results: "collections.defaultdict[str, collections.defaultdict[ height=1080, width=1920 * num_loops, title_text=f"Coroutine Performance Metrics: {input_file}", - showlegend=False, + showlegend=True, ) for col in range(1, num_loops + 1): fig.update_xaxes(title_text="speedup (% optimized away)", row=4, col=col) -- cgit v1.2.3