matplotlib.pyplot How to name different lines in the same plot?
You can give each line a label.
plt.plot(x_A,y_A,'g--', label='x_A')
These labels can then be displayed in a legend with
legend()
legend
takes some arguments, see the documentation to see what it can do.
import matplotlib.pyplot as plt
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()