Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 584 Bytes

144.md

File metadata and controls

28 lines (24 loc) · 584 Bytes
@author jackzhenguo
@desc
@tag
@version 
@date 2020/02/11
# 导入库
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# 生成数据集
data = np.random.random((6,6))
np.fill_diagonal(data,np.ones(6))
features = ["prop1","prop2","prop3","prop4","prop5", "prop6"]
data = pd.DataFrame(data, index = features, columns=features)
print(data)
# 绘制热力图
heatmap_plot = sns.heatmap(data, center=0, cmap='gist_rainbow')
plt.show()
[上一个例子](143.md) [下一个例子](145.md)