I'm plotting multiple points in Basemap and would like to have a legend to signify the category that each color represents. However, since I have multiple points in each category, the legend pulls each of those points, giving me multiple entries of the same category in the legend. Is there a way to just show one overall color-category listing?
m = Basemap(llcrnrlon=30.,llcrnrlat=20.,urcrnrlon=-160.,urcrnrlat=63.,projection='lcc',resolution='c',lat_1=20.,lat_2=40.,lon_0=90.,lat_0=50.)
X,Y = m(lon,lat)
m.drawcountries()
m.drawmapboundary(fill_color='lightblue')
m.drawparallels(np.arange(0.,90.,5.),color='gray',dashes=[1,3],labels=[1,0,0,0])
m.drawmeridians(np.arange(0.,360.,15.),color='gray',dashes=[1,3],labels=[0,0,0,1])
m.fillcontinents(color='beige',lake_color='lightblue')
plt.title('MERRA-Observation Correlations')
for j in range(len(corr)):
if j == 0 or j == 1 or j ==2:
m.plot(X[j],Y[j],'o',color='orange',markersize=np.absolute(corr[j])*17.5,label='Prairie')
if j == 3 or j ==4 or j == 5:
m.plot(X[j],Y[j],'o',color='violet',markersize=np.absolute(corr[j])*17.5,label='Tundra')
if j ==6 or j == 7 or j == 8:
m.plot(X[j],Y[j],'o',color='purple',markersize=np.absolute(corr[j])*17.5,label='Taiga')
plt.legend()
NOTE: I've placed plt.legend both inside and outside the loop with the same results.