If you plot several lines or points with matplotlib, sometimes you might find a situation where you will have repeated lables. For example:
for i in range(5):
Y1=boatarrays[i]
Y2=cararrays[i]
ax.plot(X,Y1,color='r',label='Boats')
ax.plot(X,Y2,color='b',label='Cars')
How to only have 'Boats'
and 'Cars'
only appear once?