My data has 12 columns. Columns F1, F2, ..., F11) are features. Column 12 contains the label of these features either yes or no.
I would like to plot a boxplot of all these 11 features against the label, but separate by yes or no.
My code so far is:
names=['f1','f2',......'f11']
for i in range(11):
yes = df[df['class']=='YES'][names[i]]
no = df[df['class']=='NO'][names[i]]
fig,axes = plt.subplots(figsize=(8,8))
bp = axes.boxplot([yes,no], labels=['YES', 'NO'],patch_artist=True)
for box in bp['boxes']:
box.set(color='#7570b3', linewidth=2)
box.set(facecolor = '#FF0000')
My question is: How to show F2, F3, ..., F11 against the label in one graph with some gap in between?
as in the question linked for R (Plot multiple boxplot in one graph)