1 參考 https://zhuanlan.zhihu.com/p/24952180 2 軸線中文亂碼和正負號錯誤 import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['SimHei'] #用來正常顯示中文標簽 plt.rcParams['axes.unicode_minus'] = False #用來正常顯示負號 3 基礎(chǔ)畫圖 x = [1, 2, 3, 4, 5]# Make an array of x values y = [1, 4, 9, 16, 25]# Make an array of y values for each x value pl.plot(x, y)# use pylab to plot x and y pl.show()# show the plot on the screen 4 設(shè)置軸線名稱 plt.xlabel(u'方差 *10^(-3)', fontproperties='SimHei') plt.ylabel(u'概率/%', fontproperties='SimHei') # 如果沒有使用上述中文亂碼解決方案,也可以用這個 5 設(shè)置多條曲線 plt.plot(x1, y1, 'x++', label="合成語音") plt.plot(x2, y2, 'r--', label="自然語音") plt.legend(loc='upper right')