79704555

Date: 2025-07-17 09:08:07
Score: 2
Natty:
Report link

Using the \mathregular line worked.

Thanks to import-random for directing me to an answer containing this expression.

Example shown:

import matplotlib.pyplot as plt

import matplotlib as mpl
mpl.rcParams['font.family'] = "serif"
mpl.rcParams['font.serif'] = "cmr10"
mpl.rcParams['axes.formatter.use_mathtext'] = True

fig, ax = plt.subplots()

ax.set_title('Results',fontsize=18)
ax.set_ylabel('Heat Flux ($\mathregular{W/cm^{2}}$)',fontsize=18)
ax.set_xlabel('Wall Superheat (K)',fontsize=18)

This generates the '2' in the correct font.

enter image description here

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: simply_a_student