擅长:python、mysql、java
<p>只需在表达式中使用<code>\mathregular{whatever}</code>。</p>
<p>例如:</p>
<pre><code>import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.text(0.2, 0.7, 'No mathtex')
ax.text(0.2, 0.5, 'This superscript $is^{in}$ italics')
ax.text(0.2, 0.3, 'While this $\mathregular{is^{really}}$ the same font')
plt.show()
</code></pre>
<p><img src="https://i.stack.imgur.com/5Gv8p.png" alt="enter image description here"/></p>
<p>有关详细信息,请参见<a href="http://matplotlib.org/users/mathtext.html" rel="noreferrer">http://matplotlib.org/users/mathtext.html</a>。</p>