可以使用matplotlib库中的方法添加标签。
示例代码:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(range(1, 6), [1, 4, 2, 5, 3])
ax.set_xlabel('X轴标签') ax.set_ylabel('Y轴标签') ax.set_title('图表标题')
ax.xaxis.set_label_coords(0.5, -0.15) ax.yaxis.set_label_coords(-0.15, 0.5)
plt.show()
上一篇:把变量数组传递到另一个子程序中填充,但返回的变量为空。
下一篇:巴别扩展