import matplotlib.pyplot as plt
line1, = 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()
Python第三方库——Matplotlib_在同个figure中绘制多个图并给出legend
最新推荐文章于 2022-05-07 14:32:29 发布