![python热图](https://i-blog.csdnimg.cn/blog_migrate/deaf72db8eb65eccf229dac1e35dbb66.png)
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://i-blog.csdnimg.cn/blog_migrate/8461118d3c5614bf692c750ff0b25ea7.png)
翻译自: https://www.tutorialspoint.com/python_data_science/python_heat_maps.htm
python热图