画像のようにedgecolorが色分けされてしまうですが、stripplotと同じように色わけするにはどうすればいいでしょうか?
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import random
%matplotlib inline
df = pd.DataFrame({ 'E' :pd.Categorical(['A', 'A','A','A','B', 'B','B','B','A', 'A','A','A','B', 'B','B','B']),
'F' :pd.Categorical([ 'C','C','C','C', 'C','C','C','C','D','D','D','D','D','D','D','D']),
'G' : random.sample(range(30), k=16)})
sns.set_style('ticks')
sns.set_context('poster', rc={'axes.titlesize':10, 'axes.labelsize':10, 'xtick.labelsize':10})
plt.subplot()
plt.rcParams['figure.figsize']=[15, 15]
clrs=['b', 'y']
ax=sns.barplot(x="F", y="G", hue="E", data=df, errwidth=2, capsize=0.15, errcolor='k', dodge=True, facecolor=(1, 1, 1, 0),
linewidth=4,edgecolor=clrs)
sns.stripplot(x="F", y="G", hue="E", data=df, palette=clrs, linewidth=0, dodge=True, size=15)
ax.set_ylim([0, 10])
from matplotlib import ticker
ax.yaxis.set_major_locator(ticker.MultipleLocator(1))
sns.despine()
ax.legend(loc="lower left", bbox_to_anchor=(0., 1., 1.0, 0.05), mode="expand", ncol=3)
columncounts = [30,30,30,30,30,30,30,30,30,30]
def normaliseCounts(widths,maxwidth):
widths = np.array(widths)/float(maxwidth)
return widths
widthbars = normaliseCounts(columncounts,90)
for bar,newwidth in zip(ax.patches,widthbars):
x = bar.get_x()
width = bar.get_width()
centre = x+width/2.
bar.set_x(centre-newwidth/2.)
bar.set_width(newwidth)