python热图_Python-热图

本文介绍了Python中用于创建热图的概念,热图通过不同颜色的深浅表示数值大小,颜色深浅代表值的高低。示例展示了如何将值映射到图表的索引和列上,以生成二维热图。
摘要由CSDN通过智能技术生成
python热图

python热图

Python-热图 (Python - Heat Maps)

A heatmap contains values representing various shades of the same colour for each value to be plotted. Usually the darker shades of the chart represent higher values than the lighter shade. For a very different value a completely different colour can also be used.

热图包含表示要绘制的每个值的相同颜色的各种阴影的值。 通常,图表中较深的阴影比较浅的阴影具有更高的值。 对于非常不同的值,也可以使用完全不同的颜色。

The below example is a two-dimensional plot of values which are mapped to the indices and columns of the chart.

下面的示例是值的二维图,这些值映射到图表的索引和列。


from pandas import DataFrame
import matplotlib.pyplot as plt

data=[{2,3,4,1},{6,3,5,2},{6,3,5,4},{3,7,5,4},{2,8,1,5}]
Index= ['I1', 'I2','I3','I4','I5']
Cols = ['C1', 'C2', 'C3','C4']
df = DataFrame(data, index=Index, columns=Cols)

plt.pcolor(df)
plt.show()

Its output is as follows −

输出如下-

heatmap.png

翻译自: https://www.tutorialspoint.com/python_data_science/python_heat_maps.htm

python热图

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值