As explained in the docs, legend() only works if you pass label= to plot or explicitly call set_label. Otherwise, you need to pass the desired legends to legend, e.g.:
legend(["first line", "second line"])
As explained in the docs, legend() only works if you pass label= to plot or explicitly call set_label. Otherwise, you need to pass the desired legends to legend, e.g.:
legend(["first line", "second line"])