shamrock.utils.plot.benchmark.add_end_labels#

shamrock.utils.plot.benchmark.add_end_labels(ax_main, ax_annot, entries, x_pad=0.05, min_gap_px=25, fontsize=9)#

Place non-overlapping value callouts in a dedicated annotation axes.

ax_annot must share its y-axis with ax_main (i.e. have been created with sharey=ax_main), so a “data” y-coordinate means the same thing in either axes. Each callout is linked back to its line’s last data point in ax_main with a leader line.

Parameters#

ax_mainmatplotlib.axes.Axes

The axes holding the plotted lines.

ax_annotmatplotlib.axes.Axes

The (typically narrow, spine-less) axes the callout text is drawn into. Must share its y-axis with ax_main.

entrieslist of (float, float, str, color)

One (x, y, text, color) tuple per callout, where (x, y) is the data point the leader line points to.

x_padfloat, optional

Horizontal position of the callout text, in ax_annot axes-fraction coordinates.

min_gap_pxfloat, optional

Minimum vertical spacing between callouts, in display pixels.

fontsizefloat, optional

Font size of the callout text.