I am looking for a way to include a (matplotlib) legend that describe the size of points in a scatter plot, as this could be related to another variable, like in this basic
Building on mjp's and jpobst's answers, if you have more than two discrete sizes you can make a loop and include the labels in the call to plt.scatter():
msizes = [3, 4, 5, 6, 7]
markers = []
for size in msizes:
markers.append(plt.scatter([],[], s=size, label=size))
plt.legend(handles=markers)
Note that you can format the label using standard string formatting, such as label = ('M%d' %size) for the labels in mjp's answer.