Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I'm used to this syntax when plotting multiple lines:
plt.plot(freqs,ps,freqs,psf)
I tried different variations of label=["ps","psf"] in it, using different kind of parentheses, but I was always unable to obtain a correct legend
label=["ps","psf"]
plt.plot will return a list of handles for the lines. You can pass those to legend, along with a list of labels:
plt.plot
legend
handles=plt.plot([0,1],[5,6],[0,1],[8,7]) plt.legend(handles,["label a","label b"])
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.