要用到matplotlib: from matplotlib import pyplot as plt a=range(1,10) plt.boxplot((a,a),labels=('Mon','Tue')) plt.show()