Convert list of rgb codes to matplotlib colormap

后端 未结 1 2225
北海茫月
北海茫月 2021-02-20 03:26

I have a list of rgb values and would like to create a costum colormap from the list.

These are the example values:

my_rgbs =[\'#ece804\',\'#ece804\',\'#         


        
1条回答
  •  隐瞒了意图╮
    2021-02-20 04:00

    You want to use ListedColormap which exists for exactly this purpose:

    my_cmap = matplotlib.colors.ListedColormap(my_rgbs, name='my_colormap_name')
    

    0 讨论(0)
提交回复
热议问题