We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I want to show every class color map like the picture, how I can do it? Thanks.
The text was updated successfully, but these errors were encountered:
Hey. I used the following code snippet to do so:
from matplotlib import patches from spectral import spy_colors labelDictionary= {0:'Unknown',1:'Alfalfa', 2:'Corn-notill', 3:'Corn-mintill', 4: 'Corn', 5:'Grass-pasture', 6:'Grass-trees', 7:'Grass-pasture-mowed', 8:'Hay-windrowed', 9:'Oats', 10:'Soybean-notill', 11:'Soybean-mintill', 12:'Soybean-clean', 13:'Wheat', 14:'Woods', 15:'Buildings-Grass-Trees-Drives', 16:'Stone-Steel-Towers'} fig = plt.figure(figsize=(3,3)) ax = fig.add_subplot(111) ax.set_position([0.1,0.1,0.5,0.8]) labelPatches = [ patches.Patch(color=spy_colors[x]/255., label=labelDictionary[x]) for x in np.unique(y) ] leg = ax.legend(handles=labelPatches, ncol=2, loc='center left', bbox_to_anchor=(1.5, 0.5)) fig.savefig('SA_legend.pdf', bbox_extra_artists=(leg,), bbox_inches='tight')
Sorry, something went wrong.
No branches or pull requests
Hi. I want to show every class color map like the picture, how I can do it? Thanks.
The text was updated successfully, but these errors were encountered: