【发布时间】:2020-03-04 12:47:20
【问题描述】:
我有下面的图表,我想在图例中为每个班级添加 STD。
它是用代码创建的:
subset1=data1[feats_to_explore+['wine_class']]
f, (ax1, ax2, ax3) = plt.subplots(3, figsize=(7,14), sharey=True)
l=[ax1,ax2,ax3]
colors=['lime','deeppink','dodgerblue']
## La única modificación se da en la incorporación de la línea vertical con las medias.
for graph in l:
for i in (subset1['wine_class']).unique():
df =subset1[subset1.wine_class == i]
sns.distplot(df[feats_to_explore[l.index(graph)]], kde=False, label=i, ax=graph, color=colors[int(i)])
graph.axvline(df[feats_to_explore[l.index(graph)]].mean(),color=colors[int(i)])
graph.legend(title='Wine Class')
我想在标记(0.0、1.0 或 2.0)的右侧添加每个组的标准。有人可以在这个问题上支持我吗?
问候,
【问题讨论】:
标签: python histogram data-visualization seaborn legend