import matplotlib.lines as mlines eight = mlines.Line2D([], [], color='blue', marker='s', ls='', label='8') nine = mlines.Line2D([], [], color='blue', marker='D', ls='', label='9') # etc etc plt.legend(handles=[eight, nine])