因此,在系列图之后,您可以添加
import matplotlib.patches as mpatchesimport matplotlib.pyplot as pltNA = mpatches.Patch(color='blue', label='North America')EU = mpatches.Patch(color='green', label='Europe')AP = mpatches.Patch(color='red', label='Asia/Pacific')SA = mpatches.Patch(color='yellow', label='South America')plt.legend(handles=[NA,EU,AP,SA], loc=2)plt.show()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)