解決matplotlib中文顯示問題

在python中默認是不顯示中文的,用matplotlib繪圖時,漢字會顯示一個方框,如下代碼: import matplotlib.pyplot as plt squares = [1,4,9,16,25] plt.plot(squares, linewidth=5) #設置圖表標題,並給座標軸就加上標籤 plt.title("平方數",fontsize=24) plt.xlabel("
相關文章
相關標籤/搜索