-3

m^2 -> m2

Can python plot power characters like this image??

i just want matplotlib.pyplot plt image looks more good.

khelwood
  • 55,782
  • 14
  • 81
  • 108

1 Answers1

0

You can pass LaTeX styled strings to pyplot by wrapping them in dollar signs.

from matplotlib import pyplot as plt

plt.plot(0.5, 0.5, '$m^{2}$')
plt.show()
James
  • 32,991
  • 4
  • 47
  • 70