[Python] Logarithmic colorbar in matplotlib color plot

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    I've been trying to change tha labels and my colorbar to Logarithmic scale but I can't. I used this comand:

    plt.pcolor(xx, yy, paco, cmap='RdBu',norm=matplotlib.colors.LogNorm())



    I tried to put vmin and vmax but nothing, some of my files have nan values. In fact the first file which get in to the comand has nan in all the values. And python gives me this

    ValueError: minvalue must be positive


    Maybe I have to ignore the nan values?, any advice? this is the final result: [​IMG]

    Continue reading...

Compartilhe esta Página