Skip to content

Format the text output of so.Text() #3139

Description

@FirefoxMetzger

Is it possible to apply post-processing to the value displayed by so.Text()? I want to create a "top 5 vs. bottom 5" style plot and my naive attempt is looking a bit odd:

31333794-e870-450e-874e-26c08077d0b7

I would like to do two things:

  1. Format the value of text to something like f"{text:.2%}"
  2. set halign to "right" if its position is above some threshold so that it appears inside the bar instead of being clipped.

Sidenote: I am a big fan of the flexibility of the objects API 🚀 though I must admit I haven't fully understood the intuition behind it yet, so it could very well be that this feature exists and that I just missed it in the docs because I've searched the wrong places.

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