Ask. Plot2D.add_text / add_texts draw every text marker with the fixed font ${fs}px sans-serif (figure_esm.js, the type==='texts' branches). There is no way to make a label bold, and no outline/halo, so a label over a busy image is only as legible as its size allows.
The title/tick renderer (_drawTex) already takes {weight:'bold'} and builds the font string from it. Could add_texts accept a weight keyword ('normal' | 'bold', default 'normal') and thread it through to the marker draw, the same way fontsize is?
Nice to have, same place: an optional outline (stroke colour + width, drawn with strokeText before fillText) so a label stays readable over both a dark and a light background. That is the usual halo trick and would cover the image-annotation case completely.
Context. In DE Ground Crew we label reference-resolution rings ("2 Å", "4 Å") on the CTF power spectrum. The label sits over a half-data/half-model split with high-contrast Thon-ring stripes underneath; at 16 px plain sans-serif it reads, but only just. anyplotlib 0.8.0.
Ask.
Plot2D.add_text/add_textsdraw every text marker with the fixed font${fs}px sans-serif(figure_esm.js, thetype==='texts'branches). There is no way to make a label bold, and no outline/halo, so a label over a busy image is only as legible as its size allows.The title/tick renderer (
_drawTex) already takes{weight:'bold'}and builds the font string from it. Couldadd_textsaccept aweightkeyword ('normal' | 'bold', default'normal') and thread it through to the marker draw, the same wayfontsizeis?Nice to have, same place: an optional
outline(stroke colour + width, drawn withstrokeTextbeforefillText) so a label stays readable over both a dark and a light background. That is the usual halo trick and would cover the image-annotation case completely.Context. In DE Ground Crew we label reference-resolution rings ("2 Å", "4 Å") on the CTF power spectrum. The label sits over a half-data/half-model split with high-contrast Thon-ring stripes underneath; at 16 px plain sans-serif it reads, but only just. anyplotlib 0.8.0.