如何在箱图中显示两种颜色的性别差异?

时间:2019-09-03 02:47:35

标签: seaborn boxplot

我正在尝试使用FacetGrid在不同的箱图中绘制2个类别变量和1个数值变量。我需要在箱图中区分Genders的颜色。

以下我尝试的代码:

box_gender_order =比萨['Gender']。value_counts()。index
g = sb.FacetGrid(数据=比萨,col ='国家',高度= 3,col_order = high_math_score.head(3).index,palette = sb.color_palette(['blue','orange']),                  col_wrap = 3,margin_titles = True)
g.map(sb.boxplot,'Gender','Avg Math Score',order = box_gender_order);

尽管我看到箱形图绘制得很好,但箱形图在颜色上没有任何区别。

0 个答案:

没有答案