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