Here is a snippet of my code:
fig2 = plt.figure(figsize=(8,6))
ax1 = fig2.add_subplot(111)
ax1.scatter((logngal),(logm200),c='r',label='$0.0<z<1.0$')
ax1.plot((logngal),(curve_y_1),'y',linewidth=2,label='$slope=%s \pm %s$'%(slope1,slope1_err))
ax1.fill_between(x_pred, lower, upper, color='#888888', alpha=0.5)
p1 = mpatches.Rectangle((0, 0), 1, 1, fc="#888888",alpha=0.5)
ax1.legend([p1],['$1\sigma\/confidence\/limts$'])
fig2.show()
When I perform the above, I only see $1\sigma\/confidence\/limts$
mentioned in the legend.
Whereas as you can see that I also call label='$0.0<z<1.0$'
and label='$slope=%s \pm %s$'%(slope1,slope1_err)
in ax1.scatter
and ax1.plot
respectively.
This does not get plotted in the legend.
How do I add all the above three labels inside the legend?