Is there a way to decrease the inner padding of text shown on bar charts?

Posting here as I finally found a solution, using the “mode” “show” of uniformtext, and setting the minsize to something small and readable.

  • uniformtext
    Code: fig.update_layout(uniformtext=dict(...))
    Type: dict containing one or more of the keys listed below.
    • minsize
      Code: fig.update_layout(uniformtext_minsize=<VALUE>)
      Type: number greater than or equal to 0
      Default: 0 Sets the minimum text size between traces of the same type.
    • mode
      Code: fig.update_layout(uniformtext_mode=<VALUE>)
      Type: enumerated , one of ( False | "hide" | "show" )Determines how the font size for various text elements are uniformed between each trace type. If the computed text sizes were smaller than the minimum size defined by uniformtext.minsize using “hide” option hides the text; and using “show” option shows the text without further downscaling. Please note that if the size defined by minsize is greater than the font size defined by trace, then the minsize is used.
1 Like