[Python] How can I use a pre-made color map for my heat map in matplotlib?

Discussão em 'Python' iniciado por Stack, Julho 1, 2025.

  1. Stack

    Stack Membro Participativo

    I want to use a color map for my matplotlib heat map.

    I tried doing this:

    myHeatMap.imshow(heatMap, extent=ext, cmap=get_cmap(cm.datad["Spectral"]))


    However, the Python interpreter complains

    in get_cmap
    if name in cmap_d:
    TypeError: unhashable type: 'dict'


    What is the proper way to use one of these color maps?

    Continue reading...

Compartilhe esta Página