How Can I set the offset of superscript?

Hello, everyone. I met a trouble that drivers me nuts, I need dear you help! There are the details below!

Goals: Set a superscript in matplotlib.

import matplotlib.pyplot as plt
font_options = {"family": "Arial", "Size": 11}

figure = plt.figure(figsize=(6,5),dpi = 360)
ax = plt.subplot(111)
plt.text(0.1,0.9,"CO$_2$ flux (g C m$^{-2}$ day$^{-1}$",\

Okay! Everthing is well until the moment that I find the superscript’s font type is different witth other words. So I try to change the format of the text. Everything can be objectified. But the disappointment things happened!

First, I use the code below to set the global font type:


But the offset is too large to visible to the naked eye, which obviously not a well thing in a scientific graph. So then, I set the global setting default and use the local setting with \mathregular:

plt.text(0.1,0.9,"CO$_2$ flux (g C m$\mathregular{^{-2}}$ day$\mathregular{^{-1}}$",\

The problem still exists! So I googled this quetion and got a answer:


But no thing happened! I try to finf this code in matplotlib UG, but it seems that the FontConstantsBase has been deprecated.

Does anyone know how to solve this problem? I’ll appreciate you for your precious suggestion! Welcome to discuss this issue and look forward to your reply