Label plot lines in matplotlib
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()
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()
Leave a comment