What names can be used in plt.cm.get_cmap?

后端 未结 2 1530
無奈伤痛
無奈伤痛 2021-02-19 07:22

I have this code :

plt.scatter(data_projected[:,0],data_projected[:,1],c=digits.target
        ,edgecolors=\'none\',alpha=0.5,cmap=plt.cm.get_cmap(\'nipy_spectra         


        
2条回答
  •  别那么骄傲
    2021-02-19 08:01

    The first argument to plt.cm.get_cmap('nipy_spectral',10) is the name of a colormap. You can get a list of all available colormaps via

    import matplotlib.cm
    print(matplotlib.cm.cmap_d.keys())
    

    or you may have a look at the colormap reference.

提交回复
热议问题