How to make a colored markers legend from scratch
Following the example given in the legend guide, you can use a Line2D object instead of a marker object. The only difference to the example given in the guide is you want to set linestyle=”None” import matplotlib.lines as mlines import matplotlib.pyplot as plt blue_star = mlines.Line2D([], [], color=”blue”, marker=”*”, linestyle=”None”, markersize=10, label=”Blue stars”) red_square = … Read more