之前论文中作图遇到的,其实也很简单。

关键的代码如下:

ax.set_xlabel('Temperature ($^\circ$C)')

完整的样例代码如下:

# -*- coding: utf-8 -*-

import matplotlib.pyplot as plt
x = range(10,60,1)
y = range(-100, 0, 2)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x,y)
ax.set_xlabel('Temperature ($^\circ$C)')

最终的图像如下:

【Matplotlib】 标注摄氏度符号

提醒:关于其他特殊符号的绘制,请参考matplotlib的官方文档中关于text部分的内容。

相关文章:

  • 2021-10-22
  • 2021-10-08
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-07-08
  • 2022-12-23
  • 2021-04-30
  • 2021-05-15
相关资源
相似解决方案