绘制python中的热图

时间:2014-03-11 10:01:36

标签: python plot heatmap

我正在使用heatmap.py在python上绘制热图。我在doc(详细信息部分的同一页面)上读到'points'是“一个可迭代的元组列表,其中的内容是  | x,y坐标绘制。例如,[(1,1),(2,2),(3,3)]“

因此,我们可以指定颜色的点(x,y),但是如何指定每个点的强度(x,y)?

1 个答案:

答案 0 :(得分:2)

您不直接指定强度,它是根据您在任何给定坐标处放置的点数推断的。来自文档:

The dot is placed into the output image for each input point at the translated output image coordinate. […] Dots are blended into the output image with an additive process: as points are placed on top of each other, they become darker. After all input points have been blended into the output image, the ouput image is colored based on the darkness of each pixel.

似乎你可以通过在该区域添加更多的点来使热图的区域更加强烈。