I'm trying to change the edge color of violins in Seaborn. And the code below, worked for me.
ax=sns.violinplot(data=df, x="#", y="SleepAmount", hue="Thr", palette=my_pal, split=True,linewidth = 1, inner=None)
ax2 = sns.pointplot(x="#", y="SleepAmount", hue="Thr", data=df, dodge=0.3, join=False, palette=['black'], ax=ax,errwidth=1, ci="sd", markers="_") plt.setp(ax.collections, edgecolor="k")
plt.setp(ax2.collections, edgecolor="k")
But when I use facetgrid, I have no idea how to adopt plt.setp(ax.collections, edgecolor="k")
into facetgrid map below.
g = sns.FacetGrid(df, col="temperature",sharey=True)
g=g.map(sns.violinplot,"#", "latency", "Thr", palette=my_pal, split=True, linewidth = 1, inner=None,data=df)
g=g.map(sns.pointplot, "#", "latency", "Thr", data=df, dodge=0.3, join=False, palette=['black'],errwidth=1, ci="sd", markers="_")
I've tried so many thing. like,
sns.set_edgecolor('k')
sns.set_style( {"lines.color": "k"})
sns.set_collections({'edgecolor':'k'})
g.fig.get_edgecolor()[0].set_edge("k")
g.setp.get_collections()[0].set_edgecolor("k")
can anyone help me out?
One more quick question, Is it possible to change grid color other than whitegrid nor darkgrid? Facecolor does not work for me since it colors all the background including ticks and labels area. I just want to change only the grid area. Thank you!