python - seaborn热图y轴逆序

标签 python matplotlib heatmap seaborn

看看 this 可在 seaborn 热图文档中找到热图。

现在,y 轴从底部的 9 开始,到顶部的 0 结束。 有没有办法扭转这种局面,即从底部的 0 开始,以顶部的 9 结束?

最佳答案

看起来 ax.invert_yaxis() 解决了它。

按照您获得该图的示例:

import numpy as np; np.random.seed(0)
import seaborn as sns; sns.set()
uniform_data = np.random.rand(10, 12)
ax = sns.heatmap(uniform_data)
ax.invert_yaxis()

提供: enter image description here

关于python - seaborn热图y轴逆序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34232073/

相关文章:

javascript - heatmap.js 中消失的数据点(传单插件)

java - 返回在各种语言的函数中创建的数组和对象

python - FFmpeg 混合时两个音轨之间的匹配分贝水平?

python - 在Python中存储列表的最佳方式?

python - NSInvalidArgumentException Matplotlib OS X

python - 如何在 Pyplot 中获得平滑的平均曲线

python - 如何更新 mousemove 上的 matplotlib 图例文本

r - 热图.2 : add row/column labels on left/top without hard coding coordinates

Python 嵌套循环三角形

python - 如何将相关热图限制为有趣的单元格并添加星号以标记异常值?