Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 193 Bytes

label-plot-lines-in-matplotlib.md

File metadata and controls

11 lines (8 loc) · 193 Bytes

Label plot lines in matplotlib

Use plt.legend() to show the labels.

plt.plot(x_A,y_A,'g--', label="plot A")
plt.plot(x_B,y_B,'r-o', label="plot A")
plt.legend()
plt.show()