2
我想繪製使用條紋圖的數據集。這裏是頭(有25列):繪製帶有seaborn條紋的色調的寬矩陣
Labels Acidobacteria Actinobacteria Armatimonadetes Bacteroidetes
0 0 0 495 NaN 27859
1 1 0 1256 NaN 46582
2 0 0 1081 NaN 23798
3 1 0 2523 NaN 35088
4 0 0 1383 NaN 19338
我有這樣的數據集存儲在數據幀的大熊貓,並可以使用繪製它:
def plot():
ax = sns.stripplot(data = df)
ax.set(xlabel='Bacteria',ylabel='Abundance')
plt.setp(ax.get_xticklabels(),rotation=45)
plt.show()
爲了生產this plot。
我想設置色調以反映'Labels'
列。當我嘗試:
sns.stripplot(x=df.columns.values.tolist(),y=df,data=df,hue='Labels')
我得到:
ValueError: cannot copy sequence with size 26 to array axis with dimension 830
很好的回答!但是爲了得到一個混合了色調顏色的寬矩陣矩陣,這需要很多工作......我希望Seaborn對廣泛的圖形有更多的支持。 –