1
我有以下代码:传说与除seafile热图标签
from string import letters
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")
# Compute the correlation matrix
df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
corr = df.corr()
# Generate a mask for the upper triangle
mask = np.zeros_like(corr, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True
# Set up the matplotlib figure
f, ax = plt.subplots(figsize=(11, 9))
# Generate a custom diverging colormap
cmap = sns.diverging_palette(220, 10, as_cmap=True)
# Draw the heatmap with the mask and correct aspect ratio
sns.heatmap(corr, mask=mask, cmap=cmap, vmax=.3,
square=True, #xticklabels=5, #yticklabels=5,
linewidths=.5, cbar_kws={"shrink": .5}, ax=ax)
plt.show()
怎么可能给一个额外的传说的地方,情节的,说觉得像正确的:
A: This is my first label
B: ...
C: ...
D: ...
我还想为关联栏标注简单的“相关性”。这些数据当然不是真实的数据。
谢谢你,我很欣赏你的帮助。我会将这个问题留待一段时间,也许有人也有相关栏的解决方案。再次感谢你! – Ohumeronen