Python Matplotlib Colormap

前端 未结 3 1506
旧时难觅i
旧时难觅i 2020-12-18 10:34

I use the colormap \"jet\" to plot my graphics. But, I would like to have the lower values in white color and this colormap goes from blue to red colors. I also don\'t want

3条回答
  •  再見小時候
    2020-12-18 10:54

    There's pretty much this example on the colormaps page. Digging through the matplotlib source on my machine, jet is defined as (in _cm.py):

    _jet_data =   {'red':   ((0., 0, 0), (0.35, 0, 0), (0.66, 1, 1), (0.89,1, 1),
                             (1, 0.5, 0.5)),
                   'green': ((0., 0, 0), (0.125,0, 0), (0.375,1, 1), (0.64,1, 1),
                             (0.91,0,0), (1, 0, 0)),
                   'blue':  ((0., 0.5, 0.5), (0.11, 1, 1), (0.34, 1, 1), (0.65,0, 0),
                             (1, 0, 0))}
    

提交回复
热议问题