已知热力图数据绘制热力图
程序员文章站
2022-05-19 15:19:02
...
import matplotlib.pyplot as plt
import pandas as pd
from pandas.core.frame import DataFrame
from pandas.core.indexes.base import Index
import seaborn
models=['d-tcm-hsh','d-tcm-hdh','d-chp-hsh','d-chp-hfh','dm-chp','dm-tcm']
embed_size=[str(int(64*pow(2,i))) for i in range(1,6)]
data=[
[4667, 4278, 5279, 5574, 5361, 5444],
[5556, 4556, 5508, 6295, 6393, 5944],
[5917, 5472, 5689, 6787, 6557, 6500],
[6222, 5611, 6164, 6770, 6951, 6611],
[6083, 5667, 5836, 6492, 6721, 6500],
]
data=pd.DataFrame(data,index=embed_size,columns=models)
seaborn.heatmap(data,cmap='hot_r')
plt.title("heatmap")
plt.xlabel("models")
plt.xticks(rotation=30)
plt.ylabel("embed size")
plt.show()
上一篇: 为什么门当户对的婚姻很重要?
下一篇: 婚前同居有什么要注意的吗?