如果你像我这样的控制狂,你可能想要明确设置你所有的字体大小:import matplotlib.pyplot as pltSMALL_SIZE = 8MEDIUM_SIZE = 10BIGGER_SIZE = 12plt.rc('font', size=SMALL_SIZE) # controls default text sizesplt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes titleplt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labelsplt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labelsplt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labelsplt.rc('legend', fontsize=SMALL_SIZE) # legend fontsizeplt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title请注意,您还可以设置调用rc方法的大小matplotlib:import matplotlibSMALL_SIZE = 8matplotlib.rc('font', size=SMALL_SIZE)matplotlib.rc('axes', titlesize=SMALL_SIZE)# and so on ...