I want to use a subscript in an axis label in a matplotlib figure. Using LaTeX I would set it as $N_i$
, which gives me the italic serif font. I know I can get non-italic mathfont with \mathrm
. But I would like to get the text in the default matplotlib sans-serif font so it matches the rest of the text in the figure. Is there a way to subscript text without using latex?
Write Superscript in Matplotlib Plots Using the Dollar Sign To make subscripts, you have to write the expression inside the dollar sign using the _ and ^ symbols. If you use the _ symbol, the superscript will be under the character. If you use the ^ symbol, the superscript will be over the character.
To make text appear slightly above (superscript) or below (subscript) your regular text, you can use keyboard shortcuts. Select the character that you want to format. For superscript, press Ctrl, Shift, and the Plus sign (+) at the same time. For subscript, press Ctrl and the Equal sign (=) at the same time.
It is used when writing chemical compounds. An example of subscript is N2. Superscript is the small letter / number above a particular letter / number. An example of superscript is 25.
Subscript text appears half a character below the normal line and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O to be written as H2O. Superscript: The <sup> tag is used to add a superscript text to the HTML document. The <sup> tag defines the superscript text.
Use \mathregular
to use the font used for regular text outside of mathtext:
$\mathregular{N_i}$
Take a look here for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With