Matplotlib 函数legend()——标示不同图形的文本标签图例。 Matplotlib 函数legend() 功能描述 标示不同图形的文本标签图例。 Matplotlib 函数legend() 用法 plt.legend(loc="lower left")PythonCopy 参数说明 loc:图例在图中的地理位置。 Matplotlib 函数legend() 示例 import matplotlib.pyplot as plt import numpy as np x = np.linspace(0.05,10,1000) y = np.sin(x) plt.figure('deepinout.com 极客笔记') plt.plot(x,y,ls="-.",lw=2,c="c",label="plot figure") plt.legend(loc="lower left") plt.show()PythonCopy 运行结果如图所示。