Skip to content

add_texts: a weight (and outline) option for text markers #66

Description

@TheDrOnos

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions