[Python] How to change the colormap of Seaborn 2D histogram?

Discussão em 'Python' iniciado por Stack, Agosto 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am using Seaborn to make a 2D histogram. However, I cannot change the colormap. The existing parameters palette and color are not designed for 2D histogram. I'm looking for a parameter like cmap in plt.hist2d().

    And I have tried using plt.hist2d() as well. However, one dimension of my data is categorical, while the other is numerical. Thus, the plt.hist2d() reports error saying:


    TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
    ​

    Any suggestions?

    Continue reading...

Compartilhe esta Página