Skip to content

Standalone Graph Legend Exports

notebooks/generic/legend_mo.py exports standalone legend PNGs for the Matplotlib experiment graphs into exports/legends/.

The notebook calls src.visualisation.export_graph_legend_variants(...). In script mode it exports immediately; interactively, the Export graph legends button triggers the same export.

Exported variants cover the two graph legend families used by the experiment notebooks:

  • algorithm comparison legends for the canonical algorithm families, plus a full base/CER legend covering every possible displayed algorithm label;
  • algorithm comparison legends that append the standalone Best Handcrafted diamond marker used on suite-level comparison plots;
  • per-agent legends for the 2-, 3-, and 4-player plots used by matrix, pursuit, and native-gridworld notebooks.

Algorithm legends use the same display names, colours, and line styles as the plot helpers. Base and CER variants share their learner-family colour: base variants are solid and _CER variants are dashed. Algorithm curves do not use shape markers. Suite comparisons represent handcrafted-reward runs only with the standalone Best Handcrafted diamond marker.

Each variant is written three ways. The base file uses the same wrapped, at-most-four-column layout as graph legends. The longer_* file uses one column per label so the legend is a single horizontal row. The two_line_* file uses approximately half the labels per row, giving a two-row legend that remains readable when included at width=\textwidth above a grid of small paper panels. When a two-line legend has an uneven number of entries, the exporter renders natural-width centered rows with tight vertical anchors, so the incomplete final row is centered without adding extra vertical whitespace.