I have generated a plot with multiple line using a for loop. But I cannot add a legend to this graph. Below is the code I have tried.
for l in range(3,8,1):
seq=np.arange(0,20)
X=stats.poisson(l)
seq_pmf = X.pmf(seq)
plt.plot(seq, seq_pmf,label=l)
I want the legend labels as λ=3, λ=4...like wise
