直接上代码: from matplotlib import pyplot as plt # 参数依次为list,抬头,X轴标签,Y轴标签,XY轴的范围 def draw_hist(myList,Title,Xlabel,Ylabel,Xmin,Xmax,Ymin,Ymax): plt.hist(myList,100) plt.xlabel(Xlabel) plt.xlim(Xmin,Xmax) plt.ylabel(Ylabel) plt.ylim(Ymin,Ymax) plt.title(Ti