Python第三方库——Matplotlib_在同个figure中绘制多个图并给出legend

来源:互联网 发布:c#泛型和数组 编辑:程序博客网 时间:2024/06/05 05:54
import matplotlib.pyplot as pltline1, = plt.plot([1,2,3], linestyle='--')line2, = plt.plot([3,2,1], linewidth=4)# Create a legend for the first line.plt.legend([line1, line2], ["Line 1", "Line 2"], loc=1)plt.show()

这里写图片描述

阅读全文
0 0
原创粉丝点击