Using subscripts/superscripts in flotools

Subscript superscript examples

When creating plots in flotools, at times there is a need to use subscripts / superscripts on axis or figure titles in flotools, e.g., to include chemical formulas such as CO₂ or H₂S in the title of a plot.

Even though there is no direct support to superscript or subscript any arbitrary set of characters in flotools, for most use cases, we can work around this limitation by using unicode characters, like ⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉. Unicode character sets also include superscripted/subscripted version of some alphabets such as ⁿⁱₐ etc.

Easily find unicode characters

If you think the workaround involves pulling up some website with unicode characters and copying the ones you want to use one at a time, don’t despair – there is an easier way. Modern versions of Windows 10 and Windows 11 come with a built in shortcut to pull up a mini on-screen keyboard to browse emojis and commonly used Unicode character sets. Simply press the shortcut key Windows + . (period, and not the one in your numeric pad).

Emoji keyboard in Windows 11

The second to last tab on top allows one to browse commonly used Unicode characters sets.

Unicode character browser showing math symbols, which include superscripted and subscripted numbers

FUN FACT: flotools uses these same Unicode characters to represent units like m³

Result

flotools plot with a subscript in the title

You can see the result of using a Unicode subscript 2 (\U+2082) in the title in the image above. Although this method does not allow users to super/sub script arbitrary strings, it will address the most common use cases.