Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib custom legend

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])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matplotlib #custom #legend
ADD COMMENT
Topic
Name
3+1 =