Cross-entry comparison plots for forecasting campaigns / leaderboards.
Generalises the rank-stability bump chart and the critical-difference diagram of a manuscript’s results section into a reusable, stateless API. Both functions return a matplotlib.figure.Figure; the caller is responsible for saving and closing it. Neither function calls plt.show() nor mutates matplotlib.rcParams — styling and figure lifecycle stay with the caller (set matplotlib.use("Agg") before importing pyplot in headless environments).
Critical-difference diagram (Demsar layout) over paired entries.
Thin wrapper over scikit_posthocs.critical_difference_diagram. scikit_posthocs pulls in seaborn at import time, so it is imported lazily inside this function rather than at module scope (the same precedent as plots.diagnostics.plot_shap_summary for shap).
Mapping of entry id to display name. When given, both positions and sig_matrix are renamed before plotting, and color_palette keys (which refer to the original ids) are renamed to match.
Mapping of entry id (original id, renamed automatically when labels is given) to a color for that entry’s marker and label. scikit_posthocs requires a color for every entry in positions once a palette is given.
Bump chart of entry ranks across a set of metrics.
ranks has one row per entry (the index holds the entry id) and one column per metric, in the order the metrics should appear on the x axis. Cell values are the entry’s integer rank under that metric. A line connects each entry’s rank across the metrics; entries listed in highlight are drawn with a thicker line, a larger marker, and their given color, while every other entry shares base_color.
When True, write "label rank" to the left of the first column and "rank label" to the right of the last column for every entry. The labels are drawn with clip_on=False, so they render outside the axes box — widen the figure margins (e.g. via fig.subplots_adjust) to make room for them.
plots.comparison.plot_significance_matrix( positions, sig_matrix,*, labels=None, color_palette=None, bins=P_VALUE_BINS, shades=None, row_fmt='{position}. {label} ({rank:.0f})', xlabel='position in the panel', fontsize=5.5, label_fontsize=6.5, ax=None, figsize=(6.3, 5.0),)
Lower-triangular heatmap of every adjusted pairwise p-value.
A companion to plot_critical_difference over the same panel, and often a replacement for it. The crossbars of a critical-difference diagram are maximal sets of mutually indistinguishable entries drawn as plain spans, so a bar also covers entries it excludes, and reading membership off the span alone can invert a finding. This view gives every comparison its own cell, and it stays readable at panel sizes where the crossbar layout does not.
Entries are ordered by positions, lower first, and numbered accordingly. Each cell compares the entry naming its row with the entry whose number labels its column, so the first row is deliberately blank: the leading entry has no lower-numbered counterpart.
Fill color per band, in the order of bins. Defaults to style.SEQUENTIAL_BLUE reversed, which paints the strongest evidence darkest. Cell text switches between white and ink by WCAG luminance, so a custom ramp stays readable.