
import numpy as np import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['mathtext.fontset']='stix' plt.xlim(0, 5.5) plt.ylim(-5, 100) plt.xticks([0,1,2,3,4,5,5.5], ['','1','2','3','4','5','']) plt.yticks([0,20,40,60,80], ['0','4','8','12','16']) matplotlib.pyplot.text(0-0.1,100.1,'x$10^{2}$') plt.xlabel('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', fontsize=11) plt.ylabel('xxxxxxxxxx', fontsize=11) plt.grid(True) # 添加网格,true 首字母大写 plt.legend(loc='upper right') plt.show()
===============================================