import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(0,2,100)
def func(X):
return np.exp(X)
y = func(X)
plt.rcParams['font.family'] = 'FangSong'
plt.plot(X,y,label='指數(shù)函數(shù)圖像')
plt.legend(loc='best',fontsize=12)
plt中的label參數(shù),其實可以理解為,我們往圖形中要加入的圖例,
通過plt.legend()的方法將其顯示在圖中。文章來源:http://www.zghlxwxcb.cn/news/detail-661767.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-661767.html
到了這里,關(guān)于matplotlib中的label標簽的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!