【发布时间】:2021-04-17 15:28:55
【问题描述】:
我有这个数据框:
Position FLK
75.38 1.653608512
75.45 2.404366644
75.47 4.281285701
75.48 5.457803236
75.56 4.281285701
75.61 3.348777004
75.63 5.457803236
75.67 4.281285701
75.70 2.863168526
75.74 2.404366644
75.75 2.863168526
75.78 2.863168526
75.93 3.348777004
75.96 2.863168526
75.99 2.863168526
76.07 0.167253206
76.11 2.863168526
76.14 2.863168526
我使用这个脚本在 Seaborn 中绘制热图:
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
df = pd.read_csv("D.txt",delimiter=r"\s+",header=0)
df.set_index('Position')
FLK=(df[['FLK']]).T
sns.heatmap(FLK)
plt.show()
然后得到这个数字:
【问题讨论】:
标签: python python-2.7 matplotlib seaborn